Part Number Hot Search : 
ERIES HCS163MS ERIES MUR12 070012 MB252 KAQW216S MC2836
Product Description
Full Text Search
 

To Download P87LPC764FDH Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
   

p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp product data supersedes data of 2001 oct 26 2003 sep 03 integrated circuits
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 1 2003 sep 03 853-2401 30269 general description the p87lpc764 is a 20-pin single-chip microcontroller designed for low pin count applications demanding high-integration, low cost solutions over a wide range of performance requirements. a member of the philips low pin count family, the p87lpc764 offers programmable oscillator configurations for high and low speed crystals or rc operation, wide operating voltage range, programmable port output configurations, selectable schmitt trigger inputs, led drive outputs, and a built-in watchdog timer. the p87lpc764 is based on an accelerated 80c51 processor architecture that executes instructions at twice the rate of standard 80c51 devices. features ? an accelerated 80c51 cpu provides instruction cycle times of 300600 ns for all instructions except multiply and divide when executing at 20 mhz. execution at up to 20 mhz when v dd = 4.5 v to 6.0 v, 10 mhz when v dd = 2.7 v to 6.0 v. ? 4.5 v to 5.5 v for p87lpc764hdh. ? 2.7 v to 6.0 v operating range for digital functions. ? 4 kbytes eprom code memory. ? 128 byte ram data memory. ? 32 byte customer code eprom allows serialization of devices, storage of setup parameters, etc. ? two 16-bit counter/timers. each timer may be configured to toggle a port output upon timer overflow. ? two analog comparators. ? full duplex uart. ? i 2 c communication port. ? eight keypad interrupt inputs, plus two additional external interrupt inputs. ? four interrupt priority levels. ? watchdog timer with separate on-chip oscillator, requiring no external components. the watchdog timeout time is selectable from 8 values. ? active low reset. on-chip power-on reset allows operation with no external reset components. ? low voltage reset. one of two preset low voltage levels may be selected to allow a graceful system shutdown when power fails. may optionally be configured as an interrupt. ? oscillator fail detect. the watchdog timer has a separate fully on-chip oscillator, allowing it to perform an oscillator fail detect function. ? configurable on-chip oscillator with frequency range and rc oscillator options (selected by user programmed eprom bits). the rc oscillator option allows operation with no external oscillator components. ? programmable port output configuration options: quasi-bidirectional, open drain, push-pull, input-only. ? selectable schmitt trigger port inputs. ? led drive capability (20 ma) on all port pins. ? controlled slew rate port outputs to reduce emi. outputs have approximately 10 ns minimum ramp times. ? 15 i/o pins minimum. up to 18 i/o pins using on-chip oscillator and reset options. ? only power and ground connections are required to operate the p87lpc764 when fully on-chip oscillator and reset options are selected. ? serial eprom programming allows simple in-circuit production coding. two eprom security bits prevent reading of sensitive application programs. ? idle and power down reduced power modes. improved wakeup from power down mode (a low interrupt input starts execution). typical power down current is 1 m a. ? 20-pin dip, so, and tssop packages.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 2 ordering information type number package name description frequency temperature range ( c) version p87lpc764bd/01 so20 plastic small outline package; 20 leads; body width 7.5 mm 20 mhz (5 v), 10 mhz (3 v) 0 to +70 sot163-1 p87lpc764bd so20 plastic small outline package; 20 leads; body width 7.5 mm 20 mhz (5 v), 10 mhz (3 v) 0 to +70 sot163-1 p87lpc764bdh/01 tssop20 plastic thin shrink small outline package; 20 leads; body width 4.4 mm 20 mhz (5 v) 10 mhz (3 v) 0 to +70 sot360-1 p87lpc764bdh tssop20 plastic thin shrink small outline package; 20 leads; body width 4.4 mm 20 mhz (5 v) 10 mhz (3 v) 0 to +70 sot360-1 p87lpc764bn dip20 plastic dual in-line package; 20 leads (300 mil) 20 mhz (5 v), 10 mhz (3 v) 0 to +70 sot146-1 p87lpc764fn dip20 plastic dual in-line package; 20 leads (300 mil) 20 mhz (5 v), 10 mhz (3 v) 40 to +85 sot146-1 p87lpc764fd so20 plastic small outline package; 20 leads; body width 7.5 mm 20 mhz (5 v), 10 mhz (3 v) 40 to +85 sot163-1 P87LPC764FDH tssop20 plastic thin shrink small outline package; 20 leads; body width 4.4 mm 20 mhz (5 v), 10 mhz (3 v) 40 to +85 sot360-1 p87lpc764hdh tssop20 plastic thin shrink small outline package; 20 leads; body width 4.4 mm 16 mhz (5 v) 40 to +125 sot360-1 device comparison table 1 part type internal rc oscillator p87lpc764bd/01, bdh/01 2.5% to 5% p87lpc764bdh, hdh 10% p87lpc764bd, bn, fn, fd, fdh 25% note: 1. please see ac and dc characteristics for more details. pin configuration, 20-pin dip, so, and tssop packages su01149 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 20 cmp2/p0.0 p1.7 p1.6 rst /p1.5 v ss x1/p2.1 x2/clkout/p2.0 int1 /p1.4 sda/int0 /p1.3 scl/t0/p1.2 p0.1/cin2b p0.2/cin2a p0.3/cin1b p0.4/cin1a p0.5/cmpref v dd p0.6/cmp1 p1.0/txd p0.7/t1 p1.1/rxd 10
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 3 logic symbol t1 x1 su01150 v dd v ss txd cmp2 cin2b cin2a cin1b cin1a cmpref cmp1 clkout/x2 port 0 port 2 port 1 rxd int0 rst int1 t0 scl sda
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 4 block diagram su01151 timer 0, 1 i 2 c uart accelerated 80c51 cpu watchdog timer and oscillator port 0 configurable i/os 128 byte data ram 4k byte code eprom internal bus analog comparators port 1 configurable i/os keypad interrupt port 2 configurable i/os power monitor (power-on reset, brownout reset) configurable oscillator crystal or resonator on-chip rc oscillator
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 5 su01752 unused code memory space 32-byte customer code space (accessible via movc) unused code memory space 4 k bytes on-chip code memory interrupt vectors special function registers (only directly addressable) 128 bytes on-chip data memory (directly and indirectly addressable) 16-bit addressable bytes unused space configuration bytes ucfg1, ucfg2 (accessible via movx) unused space ffffh fcffh fce0h 1000h 0fffh ffh 80h 7fh 0000h 00h 0000h fd00h fd01h ffffh * the 87lpc764 does not support access to external data memory. however, the user configuration bytes are accessed via the movx instruction as if they were in external data memory. on-chip code memory space on-chip data memory space external data memory space* 2fh 20h figure 1. p87lpc764 program and data memory map
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 6 pin descriptions mnemonic pin no. type name and function p0.0p0.7 1, 13, 14, 1620 i/o port 0 : port 0 is an 8-bit i/o port with a user-configurable output type. port 0 latches are configured in the quasi-bidirectional mode and have either ones or zeros written to them during reset, as determined by the prhi bit in the ucfg1 configuration byte. the operation of port 0 pins as inputs and outputs depends upon the port configuration selected. each port pin is configured independently. refer to the section on i/o port configuration and the dc electrical characteristics for details. the keyboard interrupt feature operates with port 0 pins. port 0 also provides various special functions as described below. 1 o p0.0 cmp2 comparator 2 output. 20 i p0.1 cin2b comparator 2 positive input b. 19 i p0.2 cin2a comparator 2 positive input a. 18 i p0.3 cin1b comparator 1 positive input b. 17 i p0.4 cin1a comparator 1 positive input a. 16 i p0.5 cmpref comparator reference (negative) input. 14 o p0.6 cmp1 comparator 1 output. 13 i/o p0.7 t1 timer/counter 1 external count input or overflow output. p1.0p1.7 24, 812 i/o port 1 : port 1 is an 8-bit i/o port with a user-configurable output type, except for three pins as noted below. port 1 latches are configured in the quasi-bidirectional mode and have either ones or zeros written to them during reset, as determined by the prhi bit in the ucfg1 configuration byte. the operation of the configurable port 1 pins as inputs and outputs depends upon the port configuration selected. each of the configurable port pins are programmed independently. refer to the section on i/o port configuration and the dc electrical characteristics for details. port 1 also provides various special functions as described below. 12 o p1.0 txd transmitter output for the serial port. 11 i p1.1 rxd receiver input for the serial port. 10 i/o i/o p1.2 t0 timer/counter 0 external count input or overflow output. scl i 2 c serial clock input/output. when configured as an output, p1.2 is open drain, in order to conform to i 2 c specifications. 9 i i/o p1.3 int0 external interrupt 0 input. sda i 2 c serial data input/output. when configured as an output, p1.3 is open drain, in order to conform to i 2 c specifications. 8 i p1.4 int1 external interrupt 1 input. 4 i p1.5 rst external reset input (if selected via eprom configuration). a low on this pin resets the microcontroller, causing i/o ports and peripherals to take on their default states, and the processor begins execution at address 0. when used as a port pin, p1.5 is a schmitt trigger input only. p2.0p2.1 6, 7 i/o port 2 : port 2 is a 2-bit i/o port with a user-configurable output type. port 2 latches are configured in the quasi-bidirectional mode and have either ones or zeros written to them during reset, as determined by the prhi bit in the ucfg1 configuration byte. the operation of port 2 pins as inputs and outputs depends upon the port configuration selected. each port pin is configured independently. refer to the section on i/o port configuration and the dc electrical characteristics for details. port 2 also provides various special functions as described below. 7 o p2.0 x2 output from the oscillator amplifier (when a crystal oscillator option is selected via the eprom configuration). clkout cpu clock divided by 6 clock output when enabled via sfr bit and in conjunction with internal rc oscillator or external clock input. 6 i p2.1 x1 input to the oscillator circuit and internal clock generator circuits (when selected via the eprom configuration). v ss 5 i ground : 0v reference. v dd 15 i power supply : this is the power supply voltage for normal operation as well as idle and power down modes.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 7 special function registers name description sfr address bit functions and addresses msb lsb reset value e7 e6 e5 e4 e3 e2 e1 e0 acc* accumulator e0h 00h auxr1# auxiliary function register a2h kbf bod boi lpep srst 0 dps 02h 1 f7 f6 f5 f4 f3 f2 f1 f0 b* b register f0h 00h cmp1# comparator 1 control register ach ce1 cp1 cn1 oe1 co1 cmf1 00h 1 cmp2# comparator 2 control register adh ce2 cp2 cn2 oe2 co2 cmf2 00h 1 divm# cpu clock divide-by-m control 95h 00h dptr: data pointer (2 bytes) dph data pointer high byte 83h 00h dpl data pointer low byte 82h 00h cf ce cd cc cb ca c9 c8 i2cfg#* i 2 c configuration register c8h/rd slaven mastrq 0 tirun ct1 ct0 00h 1 c8h/wr slaven mastrq clrti tirun ct1 ct0 df de dd dc db da d9 d8 i2con#* i 2 c control register d8h/rd rdat atn drdy arl str stp master 80h 1 d8h/wr cxa idle cdr carl cstr cstp xstr xstp i2dat# i 2 c data register d9h/rd rdat 0 0 0 0 0 0 0 80h d9h/wr xdat x x x x x x x af ae ad ac ab aa a9 a8 ien0* interrupt enable 0 a8h ea ewd ebo es et1 ex1 et0 ex0 00h ef ee ed ec eb ea e9 e8 ien1#* interrupt enable 1 e8h eti ec1 ec2 ekb ei2 00h 1 bf be bd bc bb ba b9 b8 ip0* interrupt priority 0 b8h pwd pbo ps pt1 px1 pt0 px0 00h 1 ip0h# interrupt priority 0 high byte b7h pwdh pboh psh pt1h px1h pt0h px0h 00h 1 ff fe fd fc fb fa f9 f8 ip1* interrupt priority 1 f8h pti pc1 pc2 pkb pi2 00h 1 ip1h# interrupt priority 1 high byte f7h ptih pc1h pc2h pkbh pi2h 00h 1 kbi# keyboard interrupt 86h 00h 87 86 85 84 83 82 81 80 p0* port 0 80h t1 cmp1 cmpref cin1a cin1b cin2a cin2b cmp2 note 2 97 96 95 94 93 92 91 90 p1* port 1 90h (p1.7) (p1.6) rst int1 int0 t0 rxd txd note 2 a7 a6 a5 a4 a3 a2 a1 a0 p2* port 2 a0h x1 x2 note 2 p0m1# port 0 output mode 1 84h (p0m1.7) (p0m1.6) (p0m1.5) (p0m1.4) (p0m1.3) (p0m1.2) (p0m1.1) (p0m1.0) 00h p0m2# port 0 output mode 2 85h (p0m2.7) (p0m2.6) (p0m2.5) (p0m2.4) (p0m2.3) (p0m2.2) (p0m2.1) (p0m2.0) 00h p1m1# port 1 output mode 1 91h (p1m1.7) (p1m1.6) (p1m1.4) (p1m1.1) (p1m1.0) 00h 1 p1m2# port 1 output mode 2 92h (p1m2.7) (p1m2.6) (p1m2.4) (p1m2.1) (p1m2.0) 00h 1 p2m1# port 2 output mode 1 a4h p2s p1s p0s enclk t1oe t0oe (p2m1.1) (p2m1.0) 00h p2m2# port 2 output mode 2 a5h (p2m2.1) (p2m2.0) 00h 1 pcon power control register 87h smod1 smod0 bof pof gf1 gf0 pd idl note 3
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 8 name reset value bit functions and addresses msb lsb sfr address description d7 d6 d5 d4 d3 d2 d1 d0 psw* program status word d0h cy ac f0 rs1 rs0 ov f1 p 00h pt0ad# port 0 digital input disable f6h 00h 9f 9e 9d 9c 9b 9a 99 98 scon* serial port control 98h sm0 sm1 sm2 ren tb8 rb8 ti ri 00h sbuf serial port data buffer register 99h xxh saddr# serial port address register a9h 00h saden# serial port address enable b9h 00h sp stack pointer 81h 07h 8f 8e 8d 8c 8b 8a 89 88 tcon* timer 0 and 1 control 88h tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 00h th0 timer 0 high byte 8ch 00h th1 timer 1 high byte 8dh 00h tl0 timer 0 low byte 8ah 00h tl1 timer 1 low byte 8bh 00h tmod timer 0 and 1 mode 89h gate c/t m1 m0 gate c/t m1 m0 00h wdcon# watchdog control register a7h wdovf wdrun wdclk wds2 wds1 wds0 note 4 wdrst# watchdog reset register a6h xxh notes: * sfrs are bit addressable. # sfrs are modified from or added to the 80c51 sfrs. 1. unimplemented bits in sfrs are x (unknown) at all times. ones should not be written to these bits since they may be used for other purposes in future derivatives. the reset value shown in the table for these bits is 0. 2. i/o port values at reset are determined by the prhi bit in the ucfg1 configuration byte. 3. the pcon reset value is x x bof pof0 0 0 0b. the bof and pof flags are not affected by reset. the pof flag is set by hardwar e upon power up. the bof flag is set by the occurrence of a brownout reset/interrupt and upon power up. 4. the wdcon reset value is xx11 0000b for a watchdog reset, xx01 0000b for all other reset causes if the watchdog is enabled, a nd xx00 0000b for all other reset causes if the watchdog is disabled.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 9 functional description details of p87lpc764 functions will be described in the following sections. enhanced cpu the p87lpc764 uses an enhanced 80c51 cpu which runs at twice the speed of standard 80c51 devices. this means that the performance of the p87lpc764 running at 5 mhz is exactly the same as that of a standard 80c51 running at 10 mhz. a machine cycle consists of 6 oscillator cycles, and most instructions execute in 6 or 12 clocks. a user configurable option allows restoring standard 80c51 execution timing. in that case, a machine cycle becomes 12 oscillator cycles. in the following sections, the term acpu clocko is used to refer to the clock that controls internal instruction execution. this may sometimes be different from the externally applied clock, as in the case where the part is configured for standard 80c51 timing by means of the clkr configuration bit or in the case where the clock is divided down via the setting of the divm register. these features are described in the oscillator section. analog functions the p87lpc764 incorporates two analog comparators. in order to give the best analog function performance and to minimize power consumption, pins that are actually being used for analog functions must have the digital outputs and the digital inputs disabled. digital outputs are disabled by putting the port output into the input only (high impedance) mode as described in the i/o ports section (see page 17). digital inputs on port 0 may be disabled through the use of the pt0ad register. each bit in this register corresponds to one pin of port 0. setting the corresponding bit in pt0ad disables that pin's digital input. port bits that have their digital inputs disabled will be read as 0 by any instruction that accesses the port. analog comparators two analog comparators are provided on the p87lpc764. input and output options allow use of the comparators in a number of different configurations. comparator operation is such that the output is a logical one (which may be read in a register and/or routed to a pin) when the positive input (one of two selectable pins) is greater than the negative input (selectable from a pin or an internal reference voltage). otherwise the output is a zero. each comparator may be configured to cause an interrupt when the output value changes. comparator configuration each comparator has a control register, cmp1 for comparator 1 and cmp2 for comparator 2. the control registers are identical and are shown in figure 2. the overall connections to both comparators are shown in figure 3. there are eight possible configurations for each comparator, as determined by the control bits in the corresponding cmpn register: cpn, cnn, and oen. these configurations are shown in figure 4. the comparators function down to a v dd of 3.0v. when each comparator is first enabled, the comparator output and interrupt flag are not guaranteed to be stable for 10 microseconds. the corresponding comparator interrupt should not be enabled during that time, and the comparator interrupt flag must be cleared before the interrupt is enabled in order to prevent an immediate interrupt service. bit symbol function cmpn.7, 6 e reserved for future use. should not be set to 1 by user programs. cmpn.5 cen comparator enable. when set by software, the corresponding comparator function is enabled. comparator output is stable 10 microseconds after cen is first set. cmpn.4 cpn comparator positive input select. when 0, cinna is selected as the positive comparator input. when 1, cinnb is selected as the positive comparator input. cmpn.3 cnn comparator negative input select. when 0, the comparator reference pin cmpref is selected as the negative comparator input. when 1, the internal comparator reference v ref is selected as the negative comparator input. cmpn.2 oen output enable. when 1, the comparator output is connected to the cmpn pin if the comparator is enabled (cen = 1). this output is asynchronous to the cpu clock. cmpn.1 con comparator output, synchronized to the cpu clock to allow reading by software. cleared when the comparator is disabled (cen = 0). cmpn.0 cmfn comparator interrupt flag. this bit is set by hardware whenever the comparator output con changes state. this bit will cause a hardware interrupt if enabled and of sufficient priority. cleared by software and when the comparator is disabled (cen = 0). cmfn su01152 con oen cnn cpn cen e e 0 1 2 3 4 5 6 7 cmpn reset value: 00h not bit addressable address: ach for cmp1, adh for cmp2 figure 2. comparator control registers (cmp1 and cmp2)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 10 su01153 + (p0.4) cin1a comparator 1 (p0.3) cin1b co1 oe1 (p0.5) cmpref + (p0.2) cin2a comparator 2 (p0.1) cin2b co2 oe2 cp1 cn1 cp2 cn2 cmp2 (p0.0) cmp1 (p0.6) change detect cmf1 interrupt change detect cmf2 interrupt v ref figure 3. comparator input and output connections v ref (1.23v) v ref (1.23v) v ref (1.23v) su01154 + cinna cmpref con cpn, cnn, oen = 0 0 0 + cinna cmpref cmpn con cpn, cnn, oen = 0 0 1 + cinna cmpn con cpn, cnn, oen = 0 1 1 + cinnb cmpref cmpn con cpn, cnn, oen = 1 0 1 + cinnb cmpn con cpn, cnn, oen = 1 1 1 cpn, cnn, oen = 0 1 0 cpn, cnn, oen = 1 0 0 cpn, cnn, oen = 1 1 0 + cinna vref (1.23v) con + cinnb cmpref con + cinnb con figure 4. comparator configurations
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 11 internal reference voltage an internal reference voltage generator may supply a default reference when a single comparator input pin is used. the value of the internal reference voltage, referred to as v ref , is 1.28 v 10%. comparator interrupt each comparator has an interrupt flag cmfn contained in its configuration register. this flag is set whenever the comparator output changes state. the flag may be polled by software or may be used to generate an interrupt. the interrupt will be generated when the corresponding enable bit ecn in the ien1 register is set and the interrupt system is enabled via the ea bit in the ien0 register. comparators and power reduction modes either or both comparators may remain enabled when power down or idle mode is activated. the comparators will continue to function in the power reduction mode. if a comparator interrupt is enabled, a change of the comparator output state will generate an interrupt and wake up the processor. if the comparator output to a pin is enabled, the pin should be configured in the push-pull mode in order to obtain fast switching times while in power down mode. the reason is that with the oscillator stopped, the temporary strong pull-up that normally occurs during switching on a quasi-bidirectional port pin does not take place. comparators consume power in power down and idle modes, as well as in the normal operating mode. this fact should be taken into account when system power consumption is an issue. comparator configuration example the code shown in figure 5 is an example of initializing one comparator. comparator 1 is configured to use the cin1a and cmpref inputs, outputs the comparator result to the cmp1 pin, and generates an interrupt when the comparator output changes. the interrupt routine used for the comparator must clear the interrupt flag (cmf1 in this case) before returning. su01189 cmpinit: mov pt0ad,#30h ; disable digital inputs on pins that are used ; for analog functions: cin1a, cmpref. anl p0m2,#0cfh ; disable digital outputs on pins that are used orl p0m1,#30h ; for analog functions: cin1a, cmpref. mov cmp1,#24h ; turn on comparator 1 and set up for: ; positive input on cin1a. ; negative input from cmpref pin. ; output to cmp1 pin enabled. call delay10us ; the comparator has to start up for at ; least 10 microseconds before use. anl cmp1,#0feh ; clear comparator 1 interrupt flag. setb ec1 ; enable the comparator 1 interrupt. the ; priority is left at the current value. setb ea ; enable the interrupt system (if needed). ret ; return to caller. figure 5.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 12 i 2 c serial interface the i 2 c bus uses two wires (sda and scl) to transfer information between devices connected to the bus. the main features of the bus are: ? bidirectional data transfer between masters and slaves. ? serial addressing of slaves (no added wiring). ? acknowledgment after each transferred byte. ? multimaster bus. ? arbitration between simultaneously transmitting masters without corruption of serial data on bus. the i 2 c subsystem includes hardware to simplify the software required to drive the i 2 c bus. the hardware is a single bit interface which in addition to including the necessary arbitration and framing error checks, includes clock stretching and a bus timeout timer. the interface is synchronized to software either through polled loops or interrupts. refer to the application note an422, entitled ausing the 8xc751 microcontroller as an i 2 c bus mastero for additional discussion of the 8xc76x i 2 c interface and sample driver routines. the p87lpc764 i 2 c implementation duplicates that of the 87c751 and 87c752 except for the following details: ? the interrupt vector addresses for both the i 2 c interrupt and the timer i interrupt. ? the i 2 c sfr addresses (i2con, i2cfg, i2dat). ? the location of the i 2 c interrupt enable bit and the name of the sfr it is located within (ei2 is bit 0 in ien1). ? the location of the timer i interrupt enable bit and the name of the sfr it is located within (eti is bit 7 in ien1). ? the i 2 c and timer i interrupts have a settable priority. timer i is used to both control the timing of the i 2 c bus and also to detect a abus lockedo condition, by causing an interrupt when nothing happens on the i 2 c bus for an inordinately long period of time while a transmission is in progress. if this interrupt occurs, the program has the opportunity to attempt to correct the fault and resume i 2 c operation. six time spans are important in i 2 c operation and are insured by timer i: ? the minimum high time for scl when this device is the master. ? the minimum low time for scl when this device is a master. this is not very important for a single-bit hardware interface like this one, because the scl low time is stretched until the software responds to the i 2 c flags. the software response time normally meets or exceeds the min lo time. in cases where the software responds within min hi + min lo) time, timer i will ensure that the minimum time is met. ? the minimum scl high to sda high time in a stop condition. ? the minimum sda high to sda low time between i 2 c stop and start conditions (4.7ms, see i 2 c specification). ? the minimum sda low to scl low time in a start condition. ? the maximum scl change time while an i 2 c frame is in progress. a frame is in progress between a start condition and the following stop condition. this time span serves to detect a lack of software response on this device as well as external i 2 c problems. scl astuck lowo indicates a faulty master or slave. scl astuck higho may mean a faulty device, or that noise induced onto the i 2 c bus caused all masters to withdraw from i 2 c arbitration. the first five of these times are 4.7 ms (see i 2 c specification) and are covered by the low order three bits of timer i. timer i is clocked by the p87lpc764 cpu clock. timer i can be pre-loaded with one of four values to optimize timing for different oscillator frequencies. at lower frequencies, software response time is increased and will degrade maximum performance of the i 2 c bus. see special function register i2cfg description for prescale values (ct0, ct1). the maximum scl change time is important, but its exact span is not critical. the complete 10 bits of timer i are used to count out the maximum time. when i 2 c operation is enabled, this counter is cleared by transitions on the scl pin. the timer does not run between i 2 c frames (i.e., whenever reset or stop occurred more recently than the last start). when this counter is running, it will carry out after 1020 to 1023 machine cycles have elapsed since a change on scl. a carry out causes a hardware reset of the i 2 c interface and generates an interrupt if the timer i interrupt is enabled. in cases where the bus hang-up is due to a lack of software response by this device, the reset releases scl and allows i 2 c operation among other devices to continue. timer i is enabled to run, and will reset the i 2 c interface upon overflow, if the tirun bit in the i2cfg register is set. the timer i interrupt may be enabled via the eti bit in ien1, and its priority set by the ptih and pti bits in the ip1h and ip1 registers respectively. i 2 c interrupts if i 2 c interrupts are enabled (ea and ei2 are both set to 1), an i 2 c interrupt will occur whenever the atn flag is set by a start, stop, arbitration loss, or data ready condition (refer to the description of atn following). in practice, it is not efficient to operate the i 2 c interface in this fashion because the i 2 c interrupt service routine would somehow have to distinguish between hundreds of possible conditions. also, since i 2 c can operate at a fairly high rate, the software may execute faster if the code simply waits for the i 2 c interface. typically, the i 2 c interrupt should only be used to indicate a start condition at an idle slave device, or a stop condition at an idle master device (if it is waiting to use the i 2 c bus). this is accomplished by enabling the i 2 c interrupt only during the aforementioned conditions. reading i2con rdat the data from sda is captured into areceive datao whenever a rising edge occurs on scl. rdat is also available (with seven low-order zeros) in the i2dat register. the difference between reading it here and there is that reading i2dat clears drdy, allowing the i 2 c to proceed on to another bit. typically, the first seven bits of a received byte are read from i2dat, while the 8th is read here. then i2dat can be written to send the acknowledge bit and clear drdy. atn aattentiono is 1 when one or more of drdy, arl, str, or stp is 1. thus, atn comprises a single bit that can be tested to release the i 2 c service routine from a await loop.o drdy adata readyo (and thus atn) is set when a rising edge occurs on scl, except at idle slave. drdy is cleared by writing cdr = 1, or by writing or reading the i2dat register. the following low period on scl is stretched until the program responds by clearing drdy.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 13 bit symbol function i2con.7 rdat read: the most recently received data bit. a cxa write: clears the transmit active flag. i2con.6 atn read: atn = 1 if any of the flags drdy, arl, str, or stp = 1. a idle write: in the i 2 c slave mode, writing a 1 to this bit causes the i 2 c hardware to ignore the bus until it is needed again. i2con.5 drdy read: data ready flag, set when there is a rising edge on scl. a cdr write: writing a 1 to this bit clears the drdy flag. i2con.4 arl read: arbitration loss flag, set when arbitration is lost while in the transmit mode. a carl write: writing a 1 to this bit clears the carl flag. i2con.3 str read: start flag, set when a start condition is detected at a master or non-idle slave. a cstr write: writing a 1 to this bit clears the str flag. i2con.2 stp read: stop flag, set when a stop condition is detected at a master or non-idle slave. a cstp write: writing a 1 to this bit clears the stp flag. i2con.1 master read: indicates whether this device is currently as bus master. a xstr write: writing a 1 to this bit causes a repeated start condition to be generated. i2con.0 e read: undefined. a xstp write: writing a 1 to this bit causes a stop condition to be generated. e su01155 master stp str arl drdy atn rdat 0 1 2 3 4 5 6 7 i2con reset value: 81h bit addressable 1 address: d8h xstp xstr cstp cstr carl cdr idle cxa read write figure 6. i 2 c control register (i2con) bit symbol function i2dat.7 rdat read: the most recently received data bit, captured from sda at every rising edge of scl. reading i2dat also clears drdy and the transmit active state. a xdat write: sets the data for the next transmitted bit. writing i2dat also clears drdy and sets the transmit active state. i2dat.60 unused. e su01156 e e e e e e rdat 0 1 2 3 4 5 6 7 i2dat reset value: xxh not bit addressable address: d9h e e e e e e e xdat read write figure 7. i 2 c data register (i2dat) checking atn and drdy when a program detects atn = 1, it should next check drdy. if drdy = 1, then if it receives the last bit, it should capture the data from rdat (in i2dat or i2con). next, if the next bit is to be sent, it should be written to i2dat. one way or another, it should clear drdy and then return to monitoring atn. note that if any of arl, str, or stp is set, clearing drdy will not release scl to high, so that the i 2 c will not go on to the next bit. if a program detects atn = 1, and drdy = 0, it should go on to examine arl, str, and stp.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 14 arl aarbitration losso is 1 when transmit active was set, but this device lost arbitration to another transmitter. transmit active is cleared when arl is 1. there are four separate cases in which arl is set. 1. if the program sent a 1 or repeated start, but another device sent a 0, or a stop, so that sda is 0 at the rising edge of scl. (if the other device sent a stop, the setting of arl will be followed shortly by stp being set.) 2. if the program sent a 1, but another device sent a repeated start, and it drove sda low before scl could be driven low. (this type of arl is always accompanied by str = 1.) 3. in master mode, if the program sent a repeated start, but another device sent a 1, and it drove scl low before this device could drive sda low. 4. in master mode, if the program sent stop, but it could not be sent because another device sent a 0. str astarto is set to a 1 when an i 2 c start condition is detected at a non-idle slave or at a master. (str is not set when an idle slave becomes active due to a start bit; the slave has nothing useful to do until the rising edge of scl sets drdy.) stp astopo is set to 1 when an i 2 c stop condition is detected at a non-idle slave or at a master. (stp is not set for a stop condition at an idle slave.) master amastero is 1 if this device is currently a master on the i 2 c. master is set when mastrq is 1 and the bus is not busy (i.e., if a start bit hasn't been received since reset or a atimer io time-out, or if a stop has been received since the last start). master is cleared when arl is set, or after the software writes mastrq = 0 and then xstp = 1. writing i2con typically, for each bit in an i 2 c message, a service routine waits for atn = 1. based on drdy, arl, str, and stp, and on the current bit position in the message, it may then write i2con with one or more of the following bits, or it may read or write the i2dat register. cxa writing a 1 to aclear xmit activeo clears the transmit active state. (reading the i2dat register also does this.) regarding transmit active transmit active is set by writing the i2dat register, or by writing i2con with xstr = 1 or xstp = 1. the i 2 c interface will only drive the sda line low when transmit active is set, and the arl bit will only be set to 1 when transmit active is set. transmit active is cleared by reading the i2dat register, or by writing i2con with cxa = 1. transmit active is automatically cleared when arl is 1. idle writing 1 to aidleo causes a slave's i 2 c hardware to ignore the i 2 c until the next start condition (but if mastrq is 1, then a stop condition will cause this device to become a master). cdr writing a 1 to aclear data readyo clears drdy. (reading or writing the i2dat register also does this.) carl wr iting a 1 to aclear arbitration losso clears the arl bit. cstr writing a 1 to aclear starto clears the str bit. cstp writing a 1 to aclear stopo clears the stp bit. note that if one or more of drdy, arl, str, or stp is 1, the low time of scl is stretched until the service routine responds by clearing them. xstr writing 1s to axmit repeated starto and cdr tells the i 2 c hardware to send a repeated start condition. this should only be at a master. note that xstr need not and should not be used to send an ainitialo (non-repeated) start; it is sent automatically by the i 2 c hardware. writing xstr = 1 includes the effect of writing i2dat with xdat = 1; it sets transmit active and releases sda to high during the scl low time. after scl goes high, the i 2 c hardware waits for the suitable minimum time and then drives sda low to make the start condition. xstp writing 1s to axmit stopo and cdr tells the i 2 c hardware to send a stop condition. this should only be done at a master. if there are no more messages to initiate, the service routine should clear the mastrq bit in i2cfg to 0 before writing xstp with 1. writing xstp = 1 includes the effect of writing i2dat with xdat = 0; it sets transmit active and drives sda low during the scl low time. after scl goes high, the i 2 c hardware waits for the suitable minimum time and then releases sda to high to make the stop condition.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 15 bit symbol function i2cfg.7 slaven slave enable. writing a 1 this bit enables the slave functions of the i 2 c subsystem. if slaven and mastrq are 0, the i 2 c hardware is disabled. this bit is cleared to 0 by reset and by an i 2 c time-out. i2cfg.6 mastrq master request. writing a 1 to this bit requests mastership of the i 2 c bus. if a transmission is in progress when this bit is changed from 0 to 1, action is delayed until a stop condition is detected. a start condition is sent and drdy is set (thus making atn = 1 and generating an i 2 c interrupt). when a master wishes to release mastership status of the i 2 c, it writes a 1 to xstp in i2con. mastrq is cleared by an i 2 c time-out. i2cfg.5 clrti writing a 1 to this bit clears the timer i overflow flag. this bit position always reads as a 0. i2cfg.4 tirun writing a 1 to this bit lets timer i run; a zero stops and clears it. together with slaven, mastrq, and master, this bit determines operational modes as shown in table 1. i2cfg.2, 3 e reserved for future use. should not be set to 1 by user programs. i2cfg.1, 0 ct1, ct0 these two bits are programmed as a function of the cpu clock rate, to optimize the min hi and lo time of scl when this device is a master on the i 2 c. the time value determined by these bits controls both of these parameters, and also the timing for stop and start conditions. ct0 su01474 ct1 e e tirun clrti mastrq slaven 0 1 2 3 4 5 6 7 i2cfg reset value: 00h bit addressable address: c8h figure 8. i 2 c configuration register (i2cfg) regarding software response time because the p87lpc764 can run at 20 mhz, and because the i 2 c interface is optimized for high-speed operation, it is quite likely that an i 2 c service routine will sometimes respond to drdy (which is set at a rising edge of scl) and write i2dat before scl has gone low again. if xdat were applied directly to sda, this situation would produce an i 2 c protocol violation. the programmer need not worry about this possibility because xdat is applied to sda only when scl is low. conversely, a program that includes an i 2 c service routine may take a long time to respond to drdy. typically, an i 2 c routine operates on a flag-polling basis during a message, with interrupts from other peripheral functions enabled. if an interrupt occurs, it will delay the response of the i 2 c service routine. the programmer need not worry about this very much either, because the i 2 c hardware stretches the scl low time until the service routine responds. the only constraint on the response is that it must not exceed the timer i time-out. values to be used in the ct1 and ct0 bits are shown in table 2. to allow the i 2 c bus to run at the maximum rate for a particular oscillator frequency, compare the actual oscillator rate to the f osc max column in the table. the value for ct1 and ct0 is found in the first line of the table where cpu clock max is greater than or equal to the actual frequency. table 2 also shows the machine cycle count for various settings of ct1/ct0. this allows calculation of the actual minimum high and low times for scl as follows: scl min high  low time (in microseconds) 6 * min time count cpu clock (in mhz) for instance, at an 8 mhz frequency, with ct1/ct0 set to 1 0, the minimum scl high and low times will be 5.25 m s. table 2 also shows the timer i timeout period (given in machine cycles) for each ct1/ct0 combination. the timeout period varies because of the way in which minimum scl high and low times are measured. when the i 2 c interface is operating, timer i is pre-loaded at every scl transition with a value dependent upon ct1/ct0. the pre-load value is chosen such that a minimum scl high or low time has elapsed when timer i reaches a count of 008 (the actual value pre-loaded into timer i is 8 minus the machine cycle count).
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 16 table 1. interaction of tirun with slaven, mastrq, and master slaven, mastrq, master tirun operating mode all 0 0 the i 2 c interface is disabled. timer i is cleared and does not run. this is the state assumed after a reset. if an i 2 c application wants to ignore the i 2 c at certain times, it should write slaven, mastrq, and tirun all to zero. all 0 1 the i 2 c interface is disabled. any or all 1 0 the i 2 c interface is enabled. the 3 low-order bits of timer i run for min-time generation, but the hi-order bits do not, so that there is no checking for i 2 c being ahung.o this configuration can be used for very slow i 2 c operation. any or all 1 1 the i 2 c interface is enabled. timer i runs during frames on the i 2 c, and is cleared by transitions on scl, and by start and stop conditions. this is the normal state for i 2 c operation. table 2. ct1, ct0 values ct1, ct0 min time count (machine cycles) cpu clock max (for 100 khz i 2 c) timeout period (machine cycles) 1 0 7 8.4 mhz 1023 0 1 6 7.2 mhz 1022 0 0 5 6.0 mhz 1021 1 1 4 4.8 mhz 1020 interrupts the p87lpc764 uses a four priority level interrupt structure. this allows great flexibility in controlling the handling of the p87lpc764's many interrupt sources. the p87lpc764 supports up to 12 interrupt sources. each interrupt source can be individually enabled or disabled by setting or clearing a bit in registers ien0 or ien1. the ien0 register also contains a global disable bit, ea, which disables all interrupts at once. each interrupt source can be individually programmed to one of four priority levels by setting or clearing bits in the ip0, ip0h, ip1, and ip1h registers. an interrupt service routine in progress can be interrupted by a higher priority interrupt, but not by another interrupt of the same or lower priority. the highest priority interrupt service cannot be interrupted by any other interrupt source. so, if two requests of different priority levels are received simultaneously, the request of higher priority level is serviced. if requests of the same priority level are received simultaneously, an internal polling sequence determines which request is serviced. this is called the arbitration ranking. note that the arbitration ranking is only used to resolve simultaneous requests of the same priority level. table 3 summarizes the interrupt sources, flag bits, vector addresses, enable bits, priority bits, arbitration ranking, and whether each interrupt may wake up the cpu from power down mode. table 3. summary of interrupts description interrupt flag bit(s) vector address interrupt enable bit(s) interrupt priority arbitration ranking power down wakeup external interrupt 0 ie0 0003h ex0 (ien0.0) ip0h.0, ip0.0 1 (highest) yes timer 0 interrupt tf0 000bh et0 (ien0.1) ip0h.1, ip0.1 4 no external interrupt 1 ie1 0013h ex1 (ien0.2) ip0h.2, ip0.2 6 yes timer 1 interrupt tf1 001bh et1 (ien0.3) ip0h.3, ip0.3 9 no serial port tx and rx ti & ri 0023h es (ien0.4) ip0h.4, ip0.4 11 no brownout detect bof 002bh ebo (ien0.5) ip0h.5, ip0.5 2 yes i 2 c interrupt atn 0033h ei2 (ien1.0) ip1h.0, ip1.0 5 no kbi interrupt kbf 003bh ekb (ien1.1) ip1h.1, ip1.1 7 yes comparator 2 interrupt cmf2 0043h ec2 (ien1.2) ip1h.2, ip1.2 10 yes watchdog timer wdovf 0053h ewd (ien0.6) ip0h.6, ip0.6 3 yes comparator 1 interrupt cmf1 0063h ec1 (ien1.5) ip1h.5, ip1.5 8 yes timer i interrupt 0073h eti (ien1.7) ip1h.7, ip1.7 12 (lowest) no
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 17 external interrupt inputs the p87lpc764 has two individual interrupt inputs as well as the keyboard interrupt function. the latter is described separately elsewhere in this section. the two interrupt inputs are identical to those present on the standard 80c51 microcontroller. the external sources can be programmed to be level-activated or transition-activated by setting or clearing bit it1 or it0 in register tcon. if itn = 0, external interrupt n is triggered by a detected low at the intn pin. if itn = 1, external interrupt n is edge triggered. in this mode if successive samples of the intn pin show a high in one cycle and a low in the next cycle, interrupt request flag ien in tcon is set, causing an interrupt request. since the external interrupt pins are sampled once each machine cycle, an input high or low should hold for at least 6 cpu clocks to ensure proper sampling. if the external interrupt is transition-activated, the external source has to hold the request pin high for at least one machine cycle, and then hold it low for at least one machine cycle. this is to ensure that the transition is seen and that interrupt request flag ien is set. ien is automatically cleared by the cpu when the service routine is called. if the external interrupt is level-activated, the external source must hold the request active until the requested interrupt is actually generated. if the external interrupt is still asserted when the interrupt service routine is completed another interrupt will be generated. it is not necessary to clear the interrupt flag ien when the interrupt is level sensitive, it simply tracks the input pin level. if an external interrupt is enabled when the p87lpc764 is put into power down or idle mode, the interrupt will cause the processor to wake up and resume operation. refer to the section on power reduction modes for details. su01753 wakeup (if in power down) ea (from ien0 register) interrupt to cpu ie0 ex0 ie1 ex1 bof ebo kbf ekb cm2 ec2 wdt ewd cm1 ec1 tf0 et0 tf1 et1 ri + ti es atn ei2 figure 9. interrupt sources, interrupt enables, and power down wakeup sources
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 18 i/o ports 18 the p87lpc764 has 3 i/o ports, port 0, port 1, and port 2. the exact number of i/o pins available depend upon the oscillator and reset options chosen. at least 15 pins of the p87lpc764 may be used as i/os when a two-pin external oscillator and an external reset circuit are used. up to 18 pins may be available if fully on-chip oscillator and reset configurations are chosen. all but three i/o port pins on the p87lpc764 may be software configured to one of four types on a bit-by-bit basis, as shown in table 4. these are: quasi-bidirectional (standard 80c51 port outputs), push-pull, open drain, and input only. two configuration registers for each port choose the output type for each port pin. table 4. port output configuration settings pxm1.y pxm2.y port output mode 0 0 quasi-bidirectional 0 1 push-pull 1 0 input only (high impedance) 1 1 open drain quasi-bidirectional output configuration the default port output configuration for standard p87lpc764 i/o ports is the quasi-bidirectional output that is common on the 80c51 and most of its derivatives. this output type can be used as both an input and output without the need to reconfigure the port. this is possible because when the port outputs a logic high, it is weakly driven, allowing an external device to pull the pin low. when the pin is pulled low, it is driven strongly and able to sink a fairly large current. these features are somewhat similar to an open drain output except that there are three pull-up transistors in the quasi-bidirectional output that serve different purposes. one of these pull-ups, called the avery weako pull-up, is turned on whenever the port latch for the pin contains a logic 1. the very weak pull-up sources a very small current that will pull the pin high if it is left floating. a second pull-up, called the aweako pull-up, is turned on when the port latch for the pin contains a logic 1 and the pin itself is also at a logic 1 level. this pull-up provides the primary source current for a quasi-bidirectional pin that is outputting a 1. if a pin that has a logic 1 on it is pulled low by an external device, the weak pull-up turns off, and only the very weak pull-up remains on. in order to pull the pin low under these conditions, the external device has to sink enough current to overpower the weak pull-up and take the voltage on the port pin below its input threshold. the third pull-up is referred to as the astrongo pull-up. this pull-up is used to speed up low-to-high transitions on a quasi-bidirectional port pin when the port latch changes from a logic 0 to a logic 1. when this occurs, the strong pull-up turns on for a brief time, two cpu clocks, in order to pull the port pin high quickly. then it turns off again. the quasi-bidirectional port configuration is shown in figure 10. su01159 weak very weak strong port pin v dd 2 cpu clock delay input data port latch data n ppp figure 10. quasi-bidirectional output
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 19 open drain output configuration the open drain output configuration turns off all pull-ups and only drives the pull-down transistor of the port driver when the port latch contains a logic 0. to be used as a logic output, a port configured in this manner must have an external pull-up, typically a resistor tied to v dd . the pull-down for this mode is the same as for the quasi-bidirectional mode. the open drain port configuration is shown in figure 11. push-pull output configuration the push-pull output configuration has the same pull-down structure as both the open drain and the quasi-bidirectional output modes, but provides a continuous strong pull-up when the port latch contains a logic 1. the push-pull mode may be used when more source current is needed from a port output. the push-pull port configuration is shown in figure 12. the three port pins that cannot be configured are p1.2, p1.3, and p1.5. the port pins p1.2 and p1.3 are permanently configured as open drain outputs. they may be used as inputs by writing ones to their respective port latches. p1.5 may be used as a schmitt trigger input if the p87lpc764 has been configured for an internal reset and is not using the external reset input function rst. additionally, port pins p2.0 and p2.1 are disabled for both input and output if one of the crystal oscillator options is chosen. those options are described in the oscillator section. the value of port pins at reset is determined by the prhi bit in the ucfg1 register. ports may be configured to reset high or low as needed for the application. when port pins are driven high at reset, they are in quasi-bidirectional mode and therefore do not source large amounts of current. every output on the p87lpc764 may potentially be used as a 20 ma sink led drive output. however, there is a maximum total output current for all ports which must not be exceeded. all ports pins of the p87lpc764 have slew rate controlled outputs. this is to limit noise generated by quickly switching output signals. the slew rate is factory set to approximately 10 ns rise and fall times. the bits in the p2m1 register that are not used to control configuration of p2.1 and p2.0 are used for other purposes. these bits can enable schmitt trigger inputs on each i/o port, enable toggle outputs from timer 0 and timer 1, and enable a clock output if either the internal rc oscillator or external clock input is being used. the last two functions are described in the timer/counters and oscillator sections respectively. the enable bits for all of these functions are shown in figure 13. each i/o port of the p87lpc764 may be selected to use ttl level inputs or schmitt inputs with hysteresis. a single configuration bit determines this selection for the entire port. port pins p1.2, p1.3, and p1.5 always have a schmitt trigger input. su01160 port pin input data port latch data n figure 11. open drain output su01161 port pin v dd input data port latch data n p figure 12. push-pull output
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 20 bit symbol function p2m1.7 p2s when p2s = 1, this bit enables schmitt trigger inputs on port 2. p2m1.6 p1s when p1s = 1, this bit enables schmitt trigger inputs on port 1. p2m1.5 p0s when p0s = 1, this bit enables schmitt trigger inputs on port 0. p2m1.4 enclk when enclk is set and the 87lpc764 is configured to use the on-chip rc oscillator, a clock output is enabled on the x2 pin (p2.0). refer to the oscillator section for details. p2m1.3 t1oe when set, the p0.7 pin is toggled whenever timer 1 overflows. the output frequency is therefore one half of the timer 1 overflow rate. refer to the timer/counters section for details. p2m1.2 t0oe when set, the p1.2 pin is toggled whenever timer 0 overflows. the output frequency is therefore one half of the timer 0 overflow rate. refer to the timer/counterssection for details. p2m1.1, p2m1.0 e these bits, along with the matching bits in the p2m2 register, control the output configuration of p2.1 and p2.0 respectively, as shown in table 4. (p2m1.0) su01597 (p2m1.1) t0oe t1oe enclk p0s p1s p2s 0 1 2 3 4 5 6 7 p2m1 reset value: 00h not bit addressable address: a4h figure 13. port 2 mode register 1 (p2m1) keyboard interrupt (kbi) the keyboard interrupt function is intended primarily to allow a single interrupt to be generated when any key is pressed on a keyboard or keypad connected to specific pins of the p87lpc764, as shown in figure 14. this interrupt may be used to wake up the cpu from idle or power down modes. this feature is particularly useful in handheld, battery powered systems that need to carefully manage power consumption yet also need to be convenient to use. the p87lpc764 allows any or all pins of port 0 to be enabled to cause this interrupt. port pins are enabled by the setting of bits in the kbi register, as shown in figure 15. the keyboard interrupt flag (kbf) in the auxr1 register is set when any enabled pin is pulled low while the kbi interrupt function is active. an interrupt will generated if it has been enabled. note that the kbf bit must be cleared by software. due to human time scales and the mechanical delay associated with keyswitch closures, the kbi feature will typically allow the interrupt service routine to poll port 0 in order to determine which key was pressed, even if the processor has to wake up from power down mode. refer to the section on power reduction modes for details.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 21 su01163 kbf (kbi interrupt) ekb (from ien1 register) p0.7 kbi.7 p0.6 kbi.6 p0.5 p0.4 p0.3 p0.2 p0.1 p0.0 kbi.5 kbi.4 kbi.3 kbi.2 kbi.1 kbi.0 figure 14. keyboard interrupt bit symbol function kbi.7 kbi.7 when set, enables p0.7 as a cause of a keyboard interrupt. kbi.6 kbi.6 when set, enables p0.6 as a cause of a keyboard interrupt. kbi.5 kbi.5 when set, enables p0.5 as a cause of a keyboard interrupt. kbi.4 kbi.4 when set, enables p0.4 as a cause of a keyboard interrupt. kbi.3 kbi.3 when set, enables p0.3 as a cause of a keyboard interrupt. kbi.2 kbi.2 when set, enables p0.2 as a cause of a keyboard interrupt. kbi.1 kbi.1 when set, enables p0.1 as a cause of a keyboard interrupt. kbi.0 kbi.0 when set, enables p0.0 as a cause of a keyboard interrupt. note: the keyboard interrupt must be enabled in order for the settings of the kbi register to be effective. the interrupt flag (kbf) is located at bit 7 of auxr1. kbi.0 su01164 kbi.1 kbi.2 kbi.3 kbi.4 kbi.5 kbi.6 kbi.7 0 1 2 3 4 5 6 7 kbi reset value: 00h not bit addressable address: 86h figure 15. keyboard interrupt register (kbi)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 22 oscillator the p87lpc764 provides several user selectable oscillator options, allowing optimization for a range of needs from high precision to lowest possible cost. these are configured when the eprom is programmed. basic oscillator types that are supported include: low, medium, and high speed crystals, covering a range from 20 khz to 20 mhz; ceramic resonators; and on-chip rc oscillator. low frequency oscillator option this option supports an external crystal in the range of 20 khz to 100 khz. table 5 shows capacitor values that may be used with a quartz crystal in this mode. table 5. recommended oscillator capacitors for use with the low frequency oscillator option oscillator v dd = 2.7 to 4.5 v v dd = 4.5 to 6.0 v frequency lower limit optimal value upper limit lower limit optimal value upper limit 20 khz 15 pf 15 pf 33 pf 33 pf 33 pf 47 pf 32 khz 15 pf 15 pf 33 pf 33 pf 33 pf 47 pf 100 khz 15 pf 15 pf 33 pf 15 pf 15 pf 33 pf medium frequency oscillator option this option supports an external crystal in the range of 100 khz to 4 mhz. ceramic resonators are also supported in this config uration. table 6 shows capacitor values that may be used with a quartz crystal in this mode. table 6. recommended oscillator capacitors for use with the medium frequency oscillator option oscillator fre- v dd = 2.7 to 4.5 v v dd = 4.5 to 6.0 v quency lower limit optimal value upper limit lower limit optimal value upper limit 100 khz 33 pf 33 pf 47 pf 33 pf 33 pf 47 pf 1 mhz 15 pf 15 pf 33 pf 15 pf 22 pf 47 pf 4 mhz 15 pf 15 pf 33 pf 15 pf 15 pf 33 pf high frequency oscillator option this option supports an external crystal in the range of 4 to 20 mhz. ceramic resonators are also supported in this configurati on. table 7 shows capacitor values that may be used with a quartz crystal in this mode. table 7. recommended oscillator capacitors for use with the high frequency oscillator option oscillator v dd = 2.7 to 4.5 v v dd = 4.5 to 6.0 v frequency lower limit optimal value upper limit lower limit optimal value upper limit 4 mhz 15 pf 33 pf 47 pf 15 pf 33 pf 68 pf 8 mhz 15 pf 15 pf 33 pf 15 pf 33 pf 47 pf 16 mhz 15 pf 15 pf 33 pf 20 mhz 15 pf 15 pf 33 pf on-chip rc oscillator option the on-chip rc oscillator option has a typical frequency of 6 mhz and can be divided down for slower operation through the use of the divm register. for on-chip oscillator tolerance see ac electrical characteristics table. a clock output on the x2/p2.0 pin may be enabled when the on-chip rc oscillator is used. external clock input option in this configuration, the processor clock is input from an external source driving the x1/p2.1 pin. the rate may be from 0 hz up to 20 mhz when v dd is above 4.5 v and up to 10 mhz when v dd is below 4.5 v. when the external clock input mode is used, the x2/p2.0 pin may be used as a standard port pin. a clock output on the x2/p2.0 pin may be enabled when the external clock input is used. clock output the p87lpc764 supports a clock output function when either the on-chip rc oscillator or external clock input options are selected. this allows external devices to synchronize to the p87lpc764. when enabled, via the enclk bit in the p2m1 register, the clock output appears on the x2/clkout pin whenever the on-chip oscillator is running, including in idle mode. the frequency of the clock output is 1/6 of the cpu clock rate. if the clock output is not needed in idle mode, it may be turned off prior to entering idle, saving additional power. the clock output may also be enabled when the external clock input option is selected.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 23 su01165 87lpc764 quartz crystal or ceramic resonator x2 x1 the oscillator must be configured in one of the following modes: low frequency crystal medium frequency crystal high frequency crystal * capacitor values may be optimized for different oscillator frequencies (see text) a series resistor may be required in order to limit crystal drive levels. this is particularly important for low frequency crystals (see text). figure 16. using the crystal oscillator su01166 87lpc764 x2 x1 the oscillator must be configured in the external clock input mode. a clock output may be obtained on the x2 pin by setting the enclk bit in the p2m1 register. cmos compatible external oscillator signal figure 17. using an external clock input
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 24 su01167 clock select clock sources clock out xtal select internal rc oscillator crystal: low frequency crystal: medium frequency crystal: high frequency external clock input 10-bit ripple counter reset count count 256 count 1024 oscillator startup timer divide-by-m (divm register) and clkr select cpu clock 1/ 2 clkr (ucfg1.3) power down power monitor reset fosc0 (ucfg1.0) fosc1 (ucfg1.1) fosc2 (ucfg1.2) figure 18. block diagram of oscillator control cpu clock modification: clkr and divm for backward compatibility, the clkr configuration bit allows setting the p87lpc764 instruction and peripheral timing to match standard 80c51 timing by dividing the cpu clock by two. default timing for the p87lpc764 is 6 cpu clocks per machine cycle while standard 80c51 timing is 12 clocks per machine cycle. this division also applies to peripheral timing, allowing 80c51 code that is oscillator frequency and/or timer rate dependent. the clkr bit is located in the eprom configuration register ucfg1, described under eprom characteristics in addition to this, the cpu clock may be divided down from the oscillator rate by a programmable divider, under program control. this function is controlled by the divm register. if the divm register is set to zero (the default value), the cpu will be clocked by either the unmodified oscillator rate, or that rate divided by two, as determined by the previously described clkr function. when the divm register is set to some value n (between 1 and 255), the cpu clock is divided by 2 * (n + 1). clock division values from 4 through 512 are thus possible. this feature makes it possible to temporarily run the cpu at a lower rate, reducing power consumption, in a manner similar to idle mode. by dividing the clock, the cpu can retain the ability to respond to events other than those that can cause interrupts (i.e. events that allow exiting the idle mode) by executing its normal program at a lower rate. this can allow bypassing the oscillator startup time in cases where power down mode would otherwise be used. the value of divm may be changed by the program at any time without interrupting code execution. power monitoring functions the p87lpc764 incorporates power monitoring functions designed to prevent incorrect operation during initial power up and power loss or reduction during operation. this is accomplished with two hardware functions: power-on detect and brownout detect. brownout detection the brownout detect function allows preventing the processor from failing in an unpredictable manner if the power supply voltage drops below a certain level. the default operation is for a brownout detection to cause a processor reset, however it may alternatively be configured to generate an interrupt by setting the boi bit in the auxr1 register (auxr1.5). the p87lpc764 allows selection of two brownout levels: 2.5 v or 3.8 v. when v dd drops below the selected voltage, the brownout detector triggers and remains active until v dd is returns to a level above the brownout detect voltage. when brownout detect causes a processor reset, that reset remains active as long as v dd remains below the brownout detect voltage. when brownout detect generates an interrupt, that interrupt occurs once as v dd crosses from above to below the brownout detect voltage. for the interrupt to be processed, the interrupt system and the boi interrupt must both be enabled (via the ea and ebo bits in ien0). when brownout detect is activated, the bof flag in the pcon register is set so that the cause of processor reset may be determined by software. this flag will remain set until cleared by software.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 25 for correct activation of brownout detect, the v dd fall time must be no faster than 50 mv/ m s. when v dd is restored, is should not rise faster than 2 mv/ m s in order to insure a proper reset. the brownout voltage (2.5 v or 3.8 v) is selected via the bov bit in the eprom configuration register ucfg1. when unprogrammed (bov = 1), the brownout detect voltage is 2.5 v. when programmed (bov = 0), the brownout detect voltage is 3.8 v. if the brownout detect function is not required in an application, it may be disabled, thus saving power. brownout detect is disabled by setting the control bit bod in the auxr1 register (auxr1.6). power on detection the power on detect has a function similar to the brownout detect, but is designed to work as power comes up initially, before the power supply voltage reaches a level where brownout detect can work. when this feature is activated, the pof flag in the pcon register is set to indicate an initial power up condition. the pof flag will remain set until cleared by software. power reduction modes the p87lpc764 supports idle and power down modes of power reduction. idle mode the idle mode leaves peripherals running in order to allow them to activate the processor when an interrupt is generated. any enabled interrupt source or reset may terminate idle mode. idle mode is entered by setting the idl bit in the pcon register (see figure 19). power down mode the power down mode stops the oscillator in order to absolutely minimize power consumption. power down mode is entered by setting the pd bit in the pcon register (see figure 19). the processor can be made to exit power down mode via reset or one of the interrupt sources shown in table 5. this will occur if the interrupt is enabled and its priority is higher than any interrupt currently in progress. in power down mode, the power supply voltage may be reduced to the ram keep-alive voltage v ram . this retains the ram contents at the point where power down mode was entered. sfr contents are not guaranteed after v dd has been lowered to v ram , therefore it is recommended to wake up the processor via reset in this case. v dd must be raised to within the operating range before the power down mode is exited. since the watchdog timer has a separate oscillator, it may reset the processor upon overflow if it is running during power down. note that if the brownout detect reset is enabled, the processor will be put into reset as soon as v dd drops below the brownout voltage. if brownout detect is configured as an interrupt and is enabled, it will wake up the processor from power down mode when v dd drops below the brownout voltage. when the processor wakes up from power down mode, it will start the oscillator immediately and begin execution when the oscillator is stable. oscillator stability is determined by counting 1024 cpu clocks after start-up when one of the crystal oscillator configurations is used, or 256 clocks after start-up for the internal rc or external clock input configurations. some chip functions continue to operate and draw power during power down mode, increasing the total power used during power down. these include the brownout detect, watchdog timer, and comparators. bit symbol function pcon.7 smod1 when set, this bit doubles the uart baud rate for modes 1, 2, and 3. pcon.6 smod0 this bit selects the function of bit 7 of the scon sfr. when 0, scon.7 is the sm0 bit. when 1, scon.7 is the fe (framing error) flag. see figure 28 for additional information. pcon.5 bof brown out flag. set automatically when a brownout reset or interrupt has occurred. also set at power on. cleared by software. refer to the power monitoring functions section for additional information. pcon.4 pof power on flag. set automatically when a power-on reset has occurred. cleared by software. refer to the power monitoring functions section for additional information. pcon.3 gf1 general purpose flag 1. may be read or written by user software, but has no effect on operation. pcon.2 gf0 general purpose flag 0. may be read or written by user software, but has no effect on operation. pcon.1 pd power down control bit. setting this bit activates power down mode operation. cleared when the power down mode is terminated (see text). pcon.0 idl idle mode control bit. setting this bit activates idle mode operation. cleared when the idle mode is terminated (see text). idl su01475 pd gf0 gf1 pof bof smod0 smod1 0 1 2 3 4 5 6 7 pcon reset value: 30h for a power on reset 20h for a brownout reset 00h for other reset sources not bit addressable address: 87h figure 19. power control register (pcon)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 26 table 8. sources of wakeup from power down mode wakeup source conditions external interrupt 0 or 1 the corresponding interrupt must be enabled. keyboard interrupt the keyboard interrupt feature must be enabled and properly set up. the corresponding interrupt must be enabled. comparator 1 or 2 the comparator(s) must be enabled and properly set up. the corresponding interrupt must be enabled. watchdog timer reset the watchdog timer must be enabled via the wdte bit in the ucfg1 eprom configuration byte. watchdog timer interrupt the wdte bit in the ucfg1 eprom configuration byte must not be set. the corresponding interrupt must be enabled. brownout detect reset the bod bit in auxr1 must not be set (brownout detect not disabled). the boi bit in auxr1 must not be set (brownout interrupt disabled). brownout detect interrupt the bod bit in auxr1 must not be set (brownout detect not disabled). the boi bit in auxr1 must be set (brownout interrupt enabled). the corresponding interrupt must be enabled. reset input the external reset input must be enabled.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 27 low voltage eprom operation the eprom array contains some analog circuits that are not required when v dd is less than 4 v, but are required for a v dd greater than 4 v. the lpep bit (auxr.4), when set by software, will power down these analog circuits resulting in a reduced supply current. lpep is cleared only by power-on reset, so it may be set only for applications that always operate with v dd less than 4 v. reset the p87lpc764 has an integrated power-on reset circuit which always provides a reset when power is initially applied to the device. it is recommended to use the internal reset whenever possible to save external components and to be able to use pin p1.5 as a general-purpose input pin. the p87lpc764 can additionally be configured to use p1.5 as an external active-low reset pin rst by programming the rpd bit in the user configuration register ucfg1 to 0. the internal reset is still active on power-up of the device. while the signal on the rst pin is low, the p87lpc764 is held in reset until the signal goes high. the watchdog timer on the lpc764 can act as an oscillator fail detect because it uses an independent, fully on-chip oscillator. ucfg1 is described in the system configuration bytes section of this datasheet. su01169 87lpc764 p1.5 pin is used as digital input pin internal power-on reset active ucfg1.rpd = 1 (default) 87lpc764 rst pin is used as active-low reset pin internal power-on reset active ucfg1.rpd = 0 figure 20. using pin p1.5 as general purpose input pin or as low-active reset pin su01170 chip reset cpu clock q reset timing rpd (ucfg1.6) wdt module software reset srst (auxr1.3) power monitor reset rst /v pp pin wdte (ucfg1.7) s r figure 21. block diagram showing reset sources
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 28 timer/counters the p87lpc764 has two general purpose counter/timers which are upward compatible with the standard 80c51 timer 0 and timer 1. both can be configured to operate either as timers or event counters (see figure 22). an option to automatically toggle the t0 and/or t1 pins upon timer overflow has been added. in the atimero function, the register is incremented every machine cycle. thus, one can think of it as counting machine cycles. since a machine cycle consists of 6 cpu clock periods, the count rate is 1/6 of the cpu clock frequency. refer to the section enhanced cpu for a description of the cpu clock. in the acountero function, the register is incremented in response to a 1-to-0 transition at its corresponding external input pin, t0 or t1. in this function, the external input is sampled once during every machine cycle. when the samples of the pin state show a high in one cycle and a low in the next cycle, the count is incremented. the new count value appears in the register during the cycle following the one in which the transition was detected. since it takes 2 machine cycles (12 cpu clocks) to recognize a 1-to-0 transition, the maximum count rate is 1/6 of the cpu clock frequency. there are no restrictions on the duty cycle of the external input signal, but to ensure that a given level is sampled at least once before it changes, it should be held for at least one full machine cycle. the atimero or acountero function is selected by control bits c/t in the special function register tmod. in addition to the atimero or acountero selection, timer 0 and timer 1 have four operating modes, which are selected by bit-pairs (m1, m0) in tmod. modes 0, 1, and 2 are the same for both timers/counters. mode 3 is different. the four operating modes are described in the following text. bit symbol function tmod.7 gate gating control for timer 1. when set, timer/counter is enabled only while the int1 pin is high and the tr1 control pin is set. when cleared, timer 1 is enabled when the tr1 control bit is set. tmod.6 c/t timer or counter selector for timer 1. cleared for timer operation (input from internal system clock.) set for counter operation (input from t1 input pin). tmod.5, 4 m1, m0 mode select for timer 1 (see table below). tmod.3 gate gating control for timer 0. when set, timer/counter is enabled only while the int0 pin is high and the tr0 control pin is set. when cleared, timer 0 is enabled when the tr0 control bit is set. tmod.2 c/t timer or counter selector for timer 0. cleared for timer operation (input from internal system clock.) set for counter operation (input from t0 input pin). tmod.1, 0 m1, m0 mode select for timer 0 (see table below). m1, m0 timer mode 0 0 8048 timer atlno serves as 5-bit prescaler. 0 1 16-bit timer/counter athno and atlno are cascaded; there is no prescaler. 1 0 8-bit auto-reload timer/counter. thn holds a value which is loaded into tln when it overflows. 1 1 timer 0 is a dual 8-bit timer/counter in this mode. tl0 is an 8-bit timer/counter controlled by the standard timer 0 control bits. th0 is an 8-bit timer only, controlled by the timer 1 control bits (see text). timer 1 in this mode is stopped. m0 su01171 m1 c/t gate m0 m1 c/t gate 0 1 2 3 4 5 6 7 tmod reset value: 00h not bit addressable address: 89h t1 t0 figure 22. timer/counter mode control register (tmod)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 29 mode 0 putting either timer into mode 0 makes it look like an 8048 timer, which is an 8-bit counter with a divide-by-32 prescaler. figure 24 shows mode 0 operation. in this mode, the timer register is configured as a 13-bit register. as the count rolls over from all 1s to all 0s, it sets the timer interrupt flag tfn. the count input is enabled to the timer when trn = 1 and either gate = 0 or intn = 1. (setting gate = 1 allows the timer to be controlled by external input intn , to facilitate pulse width measurements). trn is a control bit in the special function register tcon (figure 23). the gate bit is in the tmod register. the 13-bit register consists of all 8 bits of thn and the lower 5 bits of tln. the upper 3 bits of tln are indeterminate and should be ignored. setting the run flag (trn) does not clear the registers. mode 0 operation is the same for timer 0 and timer 1. see figure 24. there are two different gate bits, one for timer 1 (tmod.7) and one for timer 0 (tmod.3). bit symbol function tcon.7 tf1 timer 1 overflow flag. set by hardware on timer/counter overflow. cleared by hardware when the interrupt is processed, or by software. tcon.6 tr1 timer 1 run control bit. set/cleared by software to turn timer/counter 1 on/off. tcon.5 tf0 timer 0 overflow flag. set by hardware on timer/counter overflow. cleared by hardware when the processor vectors to the interrupt routine, or by software. tcon.4 tr0 timer 0 run control bit. set/cleared by software to turn timer/counter 0 on/off. tcon.3 ie1 interrupt 1 edge flag. set by hardware when external interrupt 1 edge is detected. cleared by hardware when the interrupt is processed, or by software. tcon.2 it1 interrupt 1 type control bit. set/cleared by software to specify falling edge/low level triggered external interrupts. tcon.1 ie0 interrupt 0 edge flag. set by hardware when external interrupt 0 edge is detected. cleared by hardware when the interrupt is processed, or by software. tcon.0 it0 interrupt 0 type control bit. set/cleared by software to specify falling edge/low level triggered external interrupts. it0 su01172 ie0 it1 ie1 tr0 tf0 tr1 tf1 0 1 2 3 4 5 6 7 tcon reset value: 00h bit addressable address: 88h figure 23. timer/counter control register (tcon) su01173 tln (5 bits) thn (8 bits) osc/6 or osc/12 overflow tn pin tnoe toggle control c/t = 1 c/t = 0 tn pin trn gate intn pin interrupt tfn figure 24. timer/counter 0 or 1 in mode 0 (13-bit counter)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 30 mode 1 mode 1 is the same as mode 0, except that all 16 bits of the timer register (thn and tln) are used. see figure 25 mode 2 mode 2 configures the timer register as an 8-bit counter (tl1) with automatic reload, as shown in figure 26. overflow from tln not only sets tfn, but also reloads tln with the contents of thn, which must be preset by software. the reload leaves thn unchanged. mode 2 operation is the same for timer 0 and timer 1. mode 3 when timer 1 is in mode 3 it is stopped. the effect is the same as setting tr1 = 0. timer 0 in mode 3 establishes tl0 and th0 as two separate 8-bit counters. the logic for mode 3 on timer 0 is shown in figure 27. tl0 uses the timer 0 control bits: c/t , gate, tr0 and pin int0 , and tf0. th0 is locked into a timer function (counting machine cycles) and takes over the use of tr1 and tf1 from timer 1. thus, th0 now controls the atimer 1o interrupt. mode 3 is provided for applications that require an extra 8-bit timer. with timer 0 in mode 3, an p87lpc764 can look like it has three timer/counters. when timer 0 is in mode 3, timer 1 can be turned on and off by switching it into and out of its own mode 3. it can still be used by the serial port as a baud rate generator, or in any application not requiring an interrupt. su01174 tln (8 bits) thn (8 bits) osc/6 or osc/12 overflow tn pin tnoe toggle control c/t = 1 c/t = 0 tn pin trn gate intn pin interrupt tfn figure 25. timer/counter 0 or 1 in mode 1 (16-bit counter) su01392 tln (8 bits) thn (8 bits) osc/6 or osc/12 overflow tn pin tnoe toggle control c/t = 1 c/t = 0 tn pin trn gate intn pin interrupt tfn reload figure 26. timer/counter 0 or 1 in mode 2 (8-bit auto-reload)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 31 su01176 tl0 (8 bits) osc/6 or osc/12 overflow t0 pin t0oe toggle control c/t = 1 c/t = 0 t0 pin tr0 gate int0 pin interrupt tf0 th0 (8 bits) overflow t1 pin t1oe toggle control interrupt tf1 tr1 osc/6 or osc/12 figure 27. timer/counter 0 mode 3 (two 8-bit counters) timer overflow toggle output timers 0 and 1 can be configured to automatically toggle a port output whenever a timer overflow occurs. the same device pins that are used for the t0 and t1 count inputs are also used for the timer toggle outputs. this function is enabled by control bits t0oe and t1oe in the p2m1 register, and apply to timer 0 and timer 1 respectively. the port outputs will be a logic 1 prior to the first timer overflow when this mode is turned on. uart the p87lpc764 includes an enhanced 80c51 uart. the baud rate source for the uart is timer 1 for modes 1 and 3, while the rate is fixed in modes 0 and 2. because cpu clocking is different on the p87lpc764 than on the standard 80c51, baud rate calculation is somewhat different. enhancements over the standard 80c51 uart include framing error detection and automatic address recognition. the serial port is full duplex, meaning it can transmit and receive simultaneously. it is also receive-buffered, meaning it can commence reception of a second byte before a previously received byte has been read from the sbuf register. however, if the first byte still hasn't been read by the time reception of the second byte is complete, the first byte will be lost. the serial port receive and transmit registers are both accessed through special function register sbuf. writing to sbuf loads the transmit register, and reading sbuf accesses a physically separate receive register. the serial port can be operated in 4 modes: mode 0 serial data enters and exits through rxd. txd outputs the shift clock. 8 bits are transmitted or received, lsb first. the baud rate is fixed at 1/6 of the cpu clock frequency. mode 1 10 bits are transmitted (through txd) or received (through rxd): a start bit (logical 0), 8 data bits (lsb first), and a stop bit (logical 1). when data is received, the stop bit is stored in rb8 in special function register scon. the baud rate is variable and is determined by the timer 1 overflow rate. mode 2 11 bits are transmitted (through txd) or received (through rxd): start bit (logical 0), 8 data bits (lsb first), a programmable 9th data bit, and a stop bit (logical 1). when data is transmitted, the 9th data bit (tb8 in scon) can be assigned the value of 0 or 1. or, for example, the parity bit (p, in the psw) could be moved into tb8. when data is received, the 9th data bit goes into rb8 in special function register scon, while the stop bit is ignored. the baud rate is programmable to either 1/16 or 1/32 of the cpu clock frequency, as determined by the smod1 bit in pcon. mode 3 11 bits are transmitted (through txd) or received (through rxd): a start bit (logical 0), 8 data bits (lsb first), a programmable 9th data bit, and a stop bit (logical 1). in fact, mode 3 is the same as mode 2 in all respects except baud rate. the baud rate in mode 3 is variable and is determined by the timer 1 overflow rate. in all four modes, transmission is initiated by any instruction that uses sbuf as a destination register. reception is initiated in mode 0 by the condition ri = 0 and ren = 1. reception is initiated in the other modes by the incoming start bit if ren = 1.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 32 serial port control register (scon) the serial port control and status register is the special function register scon, shown in figure 28. this register contains not only the mode selection bits, but also the 9th data bit for transmit and receive (tb8 and rb8), and the serial port interrupt bits (ti and ri). the framing error bit (fe) allows detection of missing stop bits in the received data stream. the fe bit shares the bit position scon.7 with the sm0 bit. which bit appears in scon at any particular time is determined by the smod0 bit in the pcon register. if smod0 = 0, scon.7 is the sm0 bit. if smod0 = 1, scon.7 is the fe bit. once set, the fe bit remains set until it is cleared by software. this allows detection of framing errors for a group of characters without the need for monitoring it for every character individually. bit symbol function scon.7 fe framing error. this bit is set by the uart receiver when an invalid stop bit is detected. must be cleared by software. the smod0 bit in the pcon register must be 1 for this bit to be accessible. see sm0 bit below. scon.7 sm0 with sm1, defines the serial port mode. the smod0 bit in the pcon register must be 0 for this bit to be accessible. see fe bit above. scon. 6 sm1 with sm0, defines the serial port mode (see table below). sm0, sm1 uart mode baud rate 0 0 0: shift register cpu clock/6 0 1 1: 8-bit uart variable (see text) 1 0 2: 9-bit uart cpu clock/32 or cpu clock/16 1 1 3: 9-bit uart variable (see text) scon.5 sm2 enables the multiprocessor communication feature in modes 2 and 3. in mode 2 or 3, if sm2 is set to 1, then rl will not be activated if the received 9th data bit (rb8) is 0. in mode 1, if sm2=1 then ri will not be activated if a valid stop bit was not received. in mode 0, sm2 should be 0. scon.4 ren enables serial reception. set by software to enable reception. clear by software to disable reception. scon.3 tb8 the 9th data bit that will be transmitted in modes 2 and 3. set or clear by software as desired. scon.2 rb8 in modes 2 and 3, is the 9th data bit that was received. in mode 1, it sm2=0, rb8 is the stop bit that was received. in mode 0, rb8 is not used. scon.1 ti transmit interrupt flag. set by hardware at the end of the 8th bit time in mode 0, or at the beginning of the stop bit in the other modes, in any serial transmission. must be cleared by software. scon.0 ri receive interrupt flag. set by hardware at the end of the 8th bit time in mode 0, or halfway through the stop bit time in the other modes, in any serial reception (except see sm2). must be cleared by software. ri su01157 ti rb8 tb8 ren sm2 sm1 sm0/fe 0 1 2 3 4 5 6 7 scon reset value: 00h bit addressable address: 98h figure 28. serial port control register (scon)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 33 baud rates the baud rate in mode 0 is fixed: mode 0 baud rate = cpu clock/6. the baud rate in mode 2 depends on the value of bit smod1 in special function register pcon. if smod1 = 0 (which is the value on reset), the baud rate is 1/32 of the cpu clock frequency. if smod1 = 1, the baud rate is 1/16 of the cpu clock frequency. mode 2 baud rate  1  smod1 32 cpu clock frequency using timer 1 to generate baud rates when timer 1 is used as the baud rate generator, the baud rates in modes 1 and 3 are determined by the timer 1 overflow rate and the value of smod1. the timer 1 interrupt should be disabled in this application. the timer itself can be configured for either atimero or acountero operation, and in any of its 3 running modes. in the most typical applications, it is configured for atimero operation, in the auto-reload mode (high nibble of tmod = 0010b). in that case the baud rate is given by the formula: mode 1, 3 baud rate  cpu clock frequency  192(or96ifsmod1  1) 256  (th1) tables 6 and 7 list various commonly used baud rates and how they can be obtained using timer 1 as the baud rate generator. table 9. baud rates, timer values, and cpu clock frequencies for smod1 = 0 timer co nt baud rate timer co u nt 2400 4800 9600 19.2k 38.4k 57.6k 1 0.4608 0.9216 * 1.8432 * 3.6864 * 7.3728 * 11.0592 2 0.9216 1.8432 * 3.6864 * 7.3728 * 14.7456 3 1.3824 2.7648 5.5296 * 11.0592 4 * 1.8432 * 3.6864 * 7.3728 * 14.7456 5 2.3040 4.6080 9.2160 * 18.4320 6 2.7648 5.5296 * 11.0592 7 3.2256 6.4512 12.9024 8 * 3.6864 * 7.3728 * 14.7456 9 4.1472 8.2944 16.5888 10 4.6080 9.2160 * 18.4320
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 34 table 10. baud rates, timer values, and cpu clock frequencies for smod1 = 1 timer co nt baud rate timer co u nt 2400 4800 9600 19.2k 38.4k 57.6k 115.2k 1 0.2304 0.4608 0.9216 * 1.8432 * 3.6864 5.5296 * 11.0592 2 0.4608 0.9216 * 1.8432 * 3.6864 * 7.3728 * 11.0592 3 0.6912 1.3824 2.7648 5.5296 * 11.0592 16.5888 4 0.9216 * 1.8432 * 3.6864 * 7.3728 * 14.7456 5 1.1520 2.3040 4.6080 9.2160 * 18.4320 6 1.3824 2.7648 5.5296 * 11.0592 7 1.6128 3.2256 6.4512 12.9024 8 * 1.8432 * 3.6864 * 7.3728 * 14.7456 9 2.0736 4.1472 8.2944 16.5888 10 2.3040 4.6080 9.2160 * 18.4320 11 2.5344 5.0688 10.1376 12 2.7648 5.5296 * 11.0592 13 2.9952 5.9904 11.9808 14 3.2256 6.4512 12.9024 15 3.4560 6.9120 13.8240 16 * 3.6864 * 7.3728 * 14.7456 17 3.9168 7.8336 15.6672 18 4.1472 8.2944 16.5888 19 4.3776 8.7552 17.5104 20 4.6080 9.2160 * 18.4320 21 4.8384 9.6768 19.3536 notes to tables 9 and 10: 1. tables 6 and 7 apply to uart modes 1 and 3 (variable rate modes), and show cpu clock rates in mhz for standard baud rates fro m 2400 to 115.2k baud. 2. table 6 shows timer settings and cpu clock rates with the smod1 bit in the pcon register = 0 (the default after reset), while table 7 reflects the smod1 bit = 1. 3. the tables show all potential cpu clock frequencies up to 20 mhz that may be used for baud rates from 9600 baud to 115.2k bau d. other cpu clock frequencies that would give only lower baud rates are not shown. 4. table entries marked with an asterisk (*) indicate standard crystal and ceramic resonator frequencies that may be obtained fr om many sources without special ordering.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 35 more about uart mode 0 serial data enters and exits through rxd. txd outputs the shift clock. 8 bits are transmitted/received: 8 data bits (lsb first). the baud rate is fixed at 1/6 the cpu clock frequency. figure 29 shows a simplified functional diagram of the serial port in mode 0, and associated timing. transmission is initiated by any instruction that uses sbuf as a destination register. the awrite to sbufo signal at s6p2 also loads a 1 into the 9th position of the transmit shift register and tells the tx control block to commence a transmission. the internal timing is such that one full machine cycle will elapse between awrite to sbufo and activation of send. send enables the output of the shift register to the alternate output function line of p1.1 and also enable shift clock to the alternate output function line of p1.0. shift clock is low during s3, s4, and s5 of every machine cycle, and high during s6, s1, and s2. at s6p2 of every machine cycle in which send is active, the contents of the transmit shift are shifted to the right one position. as data bits shift out to the right, zeros come in from the left. when the msb of the data byte is at the output position of the shift register, then the 1 that was initially loaded into the 9th position, is just to the left of the msb, and all positions to the left of that contain zeros. this condition flags the tx control block to do one last shift and then deactivate send and set t1. both of these actions occur at s1p1 of the 10th machine cycle after awrite to sbuf.o reception is initiated by the condition ren = 1 and r1 = 0. at s6p2 of the next machine cycle, the rx control unit writes the bits 1 1111110 t o the receive shift register, and in the next clock phase activates receive. receive enable shift clock to the alternate output function line of p1.0. shift clock makes transitions at s3p1 and s6p1 of every machine cycle. at s6p2 of every machine cycle in which receive is active, the contents of the receive shift register are shifted to the left one position. the value that comes in from the right is the value that was sampled at the p1.1 pin at s5p2 of the same machine cycle. as data bits come in from the right, 1s shift out to the left. when the 0 that was initially loaded into the rightmost position arrives at the leftmost position in the shift register, it flags the rx control block to do one last shift and load sbuf. at s1p1 of the 10th machine cycle after the write to scon that cleared ri, receive is cleared as ri is set. more about uart mode 1 ten bits are transmitted (through txd), or received (through rxd): a start bit (0), 8 data bits (lsb first), and a stop bit (1). on receive, the stop bit goes into rb8 in scon. in the p87lpc764 the baud rate is determined by the timer 1 overflow rate. figure 30 shows a simplified functional diagram of the serial port in mode 1, and associated timings for transmit receive. transmission is initiated by any instruction that uses sbuf as a destination register. the awrite to sbufo signal also loads a 1 into the 9th bit position of the transmit shift register and flags the tx control unit that a transmission is requested. transmission actually commences at s1p1 of the machine cycle following the next rollover in the divide-by-16 counter. (thus, the bit times are synchronized to the divide-by-16 counter, not to the awrite to sbufo signal.) the transmission begins with activation of send which puts the start bit at txd. one bit time later, data is activated, which enables the output bit of the transmit shift register to txd. the first shift pulse occurs one bit time after that. as data bits shift out to the right, zeros are clocked in from the left. when the msb of the data byte is at the output position of the shift register, then the 1 that was initially loaded into the 9th position is just to the left of the msb, and all positions to the left of that contain zeros. this condition flags the tx control unit to do one last shift and then deactivate send and set ti. this occurs at the 10th divide-by-16 rollover after awrite to sbuf.o reception is initiated by a detected 1-to-0 transition at rxd. for this purpose rxd is sampled at a rate of 16 times whatever baud rate has been established. when a transition is detected, the divide-by-16 counter is immediately reset, and 1ffh is written into the input shift register. resetting the divide-by-16 counter aligns its rollovers with the boundaries of the incoming bit times. the 16 states of the counter divide each bit time into 16ths. at the 7th, 8th, and 9th counter states of each bit time, the bit detector samples the value of rxd. the value accepted is the value that was seen in at least 2 of the 3 samples. this is done for noise rejection. if the value accepted during the first bit time is not 0, the receive circuits are reset and the unit goes back to looking for another 1-to-0 transition. this is to provide rejection of false start bits. if the start bit proves valid, it is shifted into the input shift register, and reception of the rest of the frame will proceed. as data bits come in from the right, 1s shift out to the left. when the start bit arrives at the leftmost position in the shift register (which in mode 1 is a 9-bit register), it flags the rx control block to do one last shift, load sbuf and rb8, and set ri. the signal to load sbuf and rb8, and to set ri, will be generated if, and only if, the following conditions are met at the time the final shift pulse is generated.: 1. r1 = 0, and 2. either sm2 = 0, or the received stop bit = 1. if either of these two conditions is not met, the received frame is irretrievably lost. if both conditions are met, the stop bit goes into rb8, the 8 data bits go into sbuf, and ri is activated. at this time, whether the above conditions are met or not, the unit goes back to looking for a 1-to-0 transition in rxd.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 36 80c51 internal bus su01178 80c51 internal bus write to sbuf sbuf zero detector rxd p1.1 alt output function tx control s tx clock start q cl d serial port interrupt shift clock shift send s6 rxd p1.1 alt input function load sbuf ti input shift register start ri receive shift tx clock rx control ren ri sbuf read sbuf transmit txd p1.0 alt output function send rxd (data out) d0 d1 d5 d2 d6 d3 d4 d7 txd (shift clock) shift s1 ... s6 s1 ... s6 s1 ... s6 s1 ... s6 s1 ... s6 s1 ... s6 s1 ... s6 s1 ... s6 s1 ... s6 s1 ... s6 s1 ... s6 s1 ... s6 s1 ... s6 write to sbuf ti receive receive d0 d1 d5 d2 d6 d3 d4 d7 txd (shift clock) shift write to scon (clear ri) ri rxd (data in) 11 111 11 0 figure 29. serial port mode 0
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 37 su01179 80c51 internal bus write to sbuf sbuf zero detector txd p1.0 alt output function tx control s tx clock start q cl d serial port interrupt shift send load sbuf ti input shift register start ri load sbuf shift rx clock 1ffh rx control sbuf read sbuf transmit rxd p1.1 alt input function 80c51 internal bus data tb8 16 16 2 timer 1 overflow smod1 = 0 smod1 = 1 1-to-0 transition detector bit detector start bit stop bit tx clock write to sbuf send data shift txd ti d0 d1 d5 d2 d6 d3 d4 d7 receive rx clock shift ri bit detector sample times start bit stop bit rxd d0 d1 d5 d2 d6 d3 d4 d7 16 reset figure 30. serial port mode 1
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 38 more about uart modes 2 and 3 eleven bits are transmitted (through txd), or received (through rxd): a start bit (0), 8 data bits (lsb first), a programmable 9th data bit, and a stop bit (1). on transmit, the 9th data bit (tb8) can be assigned the value of 0 or 1. on receive, the 9the data bit goes into rb8 in scon. the baud rate is programmable to either 1/16 or 1/32 of the cpu clock frequency in mode 2. mode 3 may have a variable baud rate generated from timer 1. figures 31 and 32 show a functional diagram of the serial port in modes 2 and 3. the receive portion is exactly the same as in mode 1. the transmit portion differs from mode 1 only in the 9th bit of the transmit shift register. transmission is initiated by any instruction that uses sbuf as a destination register. the awrite to sbufo signal also loads tb8 into the 9th bit position of the transmit shift register and flags the tx control unit that a transmission is requested. transmission commences at s1p1 of the machine cycle following the next rollover in the divide-by-16 counter. (thus, the bit times are synchronized to the divide-by-16 counter, not to the awrite to sbufo signal.) the transmission begins with activation of send, which puts the start bit at txd. one bit time later, data is activated, which enables the output bit of the transmit shift register to txd. the first shift pulse occurs one bit time after that. the first shift clocks a 1 (the stop bit) into the 9th bit position of the shift register. thereafter, only zeros are clocked in. thus, as data bits shift out to the right, zeros are clocked in from the left. when tb8 is at the output position of the shift register, then the stop bit is just to the left of tb8, and all positions to the left of that contain zeros. this condition flags the tx control unit to do one last shift and then deactivate send and set ti. this occurs at the 11th divide-by-16 rollover after awrite to sbuf.o reception is initiated by a detected 1-to-0 transition at rxd. for this purpose rxd is sampled at a rate of 16 times whatever baud rate has been established. when a transition is detected, the divide-by-16 counter is immediately reset, and 1ffh is written to the input shift register. at the 7th, 8th, and 9th counter states of each bit time, the bit detector samples the value of rd. the value accepted is the value that was seen in at least 2 of the 3 samples. if the value accepted during the first bit time is not 0, the receive circuits are reset and the unit goes back to looking for another 1-to-0 transition. if the start bit proves valid, it is shifted into the input shift register, and reception of the rest of the frame will proceed. as data bits come in from the right, 1s shift out to the left. when the start bit arrives at the leftmost position in the shift register (which in modes 2 and 3 is a 9-bit register), it flags the rx control block to do one last shift, load sbuf and rb8, and set ri. the signal to load sbuf and rb8, and to set ri, will be generated if, and only if, the following conditions are met at the time the final shift pulse is generated. 1. ri = 0, and 2. either sm2 = 0, or the received 9th data bit = 1. if either of these conditions is not met, the received frame is irretrievably lost, and ri is not set. if both conditions are met, the received 9th data bit goes into rb8, and the first 8 data bits go into sbuf. one bit time later, whether the above conditions were met or not, the unit goes back to looking for a 1-to-0 transition at the rxd input. multiprocessor communications uart modes 2 and 3 have a special provision for multiprocessor communications. in these modes, 9 data bits are received or transmitted. when data is received, the 9th bit is stored in rb8. the uart can be programmed such that when the stop bit is received, the serial port interrupt will be activated only if rb8 = 1. this feature is enabled by setting bit sm2 in scon. one way to use this feature in multiprocessor systems is as follows: when the master processor wants to transmit a block of data to one of several slaves, it first sends out an address byte which identifies the target slave. an address byte differs from a data byte in that the 9th bit is 1 in an address byte and 0 in a data byte. with sm2 = 1, no slave will be interrupted by a data byte. an address byte, however, will interrupt all slaves, so that each slave can examine the received byte and see if it is being addressed. the addressed slave will clear its sm2 bit and prepare to receive the data bytes that follow. the slaves that weren't being addressed leave their sm2 bits set and go on about their business, ignoring the subsequent data bytes. sm2 has no effect in mode 0, and in mode 1 can be used to check the validity of the stop bit, although this is better done with the framing error flag. in a mode 1 reception, if sm2 = 1, the receive interrupt will not be activated unless a valid stop bit is received.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 39 start bit su01180 80c51 internal bus write to sbuf sbuf zero detector txd p1.0 alt output function tx control s tx clock start q cl d serial port interrupt shift send load sbuf ti input shift register start ri load sbuf shift rx clock 1ffh rx control sbuf read sbuf rxd p1.1 alt input function 80c51 internal bus data tb8 16 16 2 phase 2 clock (1/2 f osc ) 1-to-0 transition detector bit detector stop bit gen. smod1 = 0 smod1 = 1 transmit start bit stop bit tx clock write to sbuf send data shift txd ti d0 d1 d5 d2 d6 d3 d4 d7 receive rx clock shift ri bit detector sample times stop bit rxd d0 d1 d5 d2 d6 d3 d4 d7 16 reset tb8 stop bit gen. rb8 figure 31. serial port mode 2
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 40 bit detector su01181 transmit start bit stop bit tx clock write to sbuf send data shift txd ti d0 d1 d5 d2 d6 d3 d4 d7 receive rx clock shift ri bit detector sample times start bit stop bit rxd d0 d1 d5 d2 d6 d3 d4 d7 16 reset tb8 stop bit gen. rb8 80c51 internal bus write to sbuf sbuf zero detector txd p1.0 alt output function tx control s tx clock start q cl d serial port interrupt shift send load sbuf ti input shift register start ri load sbuf shift rx clock 1ffh rx control sbuf read sbuf rxd p1.1 alt input function 80c51 internal bus data tb8 16 16 2 timer 1 overflow smod1 = 0 smod1 = 1 1-to-0 transition detector figure 32. serial port mode 3
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 41 automatic address recognition automatic address recognition is a feature which allows the uart to recognize certain addresses in the serial bit stream by using hardware to make the comparisons. this feature saves a great deal of software overhead by eliminating the need for the software to examine every serial address which passes by the serial port. this feature is enabled by setting the sm2 bit in scon. in the 9 bit uart modes, mode 2 and mode 3, the receive interrupt flag (ri) will be automatically set when the received byte contains either the agiveno address or the abroadcasto address. the 9 bit mode requires that the 9th information bit is a 1 to indicate that the received information is an address and not data. using the automatic address recognition feature allows a master to selectively communicate with one or more slaves by invoking the given slave address or addresses. all of the slaves may be contacted by using the broadcast address. two special function registers are used to define the slave's address, saddr, and the address mask, saden. saden is used to define which bits in the saddr are to be used and which bits are adon't careo. the saden mask can be logically anded with the saddr to create the agiveno address which the master will use for addressing each of the slaves. use of the given address allows multiple slaves to be recognized while excluding others. the following examples will help to show the versatility of this scheme: slave 0 saddr = 1100 0000 saden = 1111 1101 given = 1100 00x0 slave 1 saddr = 1100 0000 saden = 1111 1110 given = 1100 000x in the above example saddr is the same and the saden data is used to differentiate between the two slaves. slave 0 requires a 0 in bit 0 and it ignores bit 1. slave 1 requires a 0 in bit 1 and bit 0 is ignored. a unique address for slave 0 would be 1100 0010 since slave 1 requires a 0 in bit 1. a unique address for slave 1 would be 1100 0001 since a 1 in bit 0 will exclude slave 0. both slaves can be selected at the same time by an address which has bit 0 = 0 (for slave 0) and bit 1 = 0 (for slave 1). thus, both could be addressed with 1100 0000. in a more complex system the following could be used to select slaves 1 and 2 while excluding slave 0: slave 0 saddr = 1100 0000 saden = 1111 1001 given = 1100 0xx0 slave 1 saddr = 1110 0000 saden = 1111 1010 given = 1110 0x0x slave 2 saddr = 1110 0000 saden = 1111 1100 given = 1110 00xx in the above example the differentiation among the 3 slaves is in the lower 3 address bits. slave 0 requires that bit 0 = 0 and it can be uniquely addressed by 1110 0110. slave 1 requires that bit 1 = 0 and it can be uniquely addressed by 1110 and 0101. slave 2 requires that bit 2 = 0 and its unique address is 1110 0011. to select slaves 0 and 1 and exclude slave 2 use address 1110 0100, since it is necessary to make bit 2 = 1 to exclude slave 2. the broadcast address for each slave is created by taking the logical or of saddr and saden. zeros in this result are treated as don't-cares. in most cases, interpreting the don't-cares as ones, the broadcast address will be ff hexadecimal. upon reset saddr and saden are loaded with 0s. this produces a given address of all adon't careso as well as a broadcast address of all adon't careso. this effectively disables the automatic addressing mode and allows the microcontroller to use standard uart drivers which do not make use of this feature. watchdog timer when enabled via the wdte configuration bit, the watchdog timer is operated from an independent, fully on-chip oscillator in order to provide the greatest possible dependability. when the watchdog feature is enabled, the timer must be fed regularly by software in order to prevent it from resetting the cpu, and it cannot be turned off. when disabled as a watchdog timer (via the wdte bit in the ucfg1 configuration register), it may be used as an interval timer and may generate an interrupt. the watchdog timer is shown in figure 33. the watchdog timeout time is selectable from one of eight values, nominal times range from 25 milliseconds to 3.2 seconds. the frequency tolerance of the independent watchdog rc oscillator is 60%. the timeout selections and other control bits are shown in figure 34. when the watchdog function is enabled, the wdcon register may be written once during chip initialization in order to set the watchdog timeout time. the recommended method of initializing the wdcon register is to first feed the watchdog, then write to wdcon to configure the wds20 bits. using this method, the watchdog initialization may be done any time within 10 milliseconds after startup without a watchdog overflow occurring before the initialization can be completed. since the watchdog timer oscillator is fully on-chip and independent of any external oscillator circuit used by the cpu, it intrinsically serves as an oscillator fail detection function. if the watchdog feature is enabled and the cpu oscillator fails for any reason, the watchdog timer will time out and reset the cpu. when the watchdog function is enabled, the timer is deactivated temporarily when a chip reset occurs from another source, such as a power on reset, brownout reset, or external reset. watchdog feed sequence if the watchdog timer is running, it must be fed before it times out in order to prevent a chip reset from occurring. the watchdog feed sequence consists of first writing the value 1eh, then the value e1h to the wdrst register. an example of a watchdog feed sequence is shown below. wdfeed: mov wdrst,#1eh ; first part of watchdog feed sequence. mov wdrst,#0e1h ; second part of watchdog feed sequence. the two writes to wdrst do not have to occur in consecutive instructions. an incorrect watchdog feed sequence does not cause any immediate response from the watchdog timer, which will still time out at the originally scheduled time if a correct feed sequence does not occur prior to that time. after a chip reset, the user program has a limited time in which to either feed the watchdog timer or change the timeout period. when a low cpu clock frequency is used in the application, the number of instructions that can be executed before the watchdog overflows may be quite small. watchdog reset if a watchdog reset occurs, the internal reset is active for approximately one microsecond. if the cpu clock was still running, code execution will begin immediately after that. if the processor was in power down mode, the watchdog reset will start the oscillator and code execution will resume after the oscillator is stable.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 42 su01754 watchdog interrupt s q 20-bit counter state clock wdte (ucfg1.7) bof (pcon.5) pof (pcon.4) watchdog reset clear 8 msbs 8 to 1 mux watchdog feed detect wdovf (wdcon.5) wds20 (wdcon.20) wdte + wdrun wdclk * wdte 500 khz rc oscillator enable clock out r figure 33. block diagram of the watchdog timer bit symbol function wdcon.7, 6 e reserved for future use. should not be set to 1 by user programs. wdcon.5 wdovf watchdog timer overflow flag. set when a watchdog reset or timer overflow occurs. cleared when the watchdog is fed. wdcon.4 wdrun watchdog run control. the watchdog timer is started when wdrun = 1 and stopped when wdrun = 0. this bit is forced to 1 (watchdog running) if the wdte configuration bit = 1. wdcon.3 wdclk watchdog clock select. the watchdog timer is clocked by cpu clock/6 when wdclk = 1 and by the watchdog rc oscillator when wdclk = 0. this bit is forced to 0 (using the watchdog rc oscillator) if the wdte configuration bit = 1. wdcon.20 wds20 watchdog rate select. wds20 timeout clocks minimum time nominal time maximum time 0 0 0 8,192 10 ms 25 ms 40 ms 0 0 1 16,384 20 ms 50 ms 80 ms 0 1 0 32,768 41 ms 100 ms 160 ms 0 1 1 65,536 82 ms 200 ms 320 ms 1 0 0 131,072 165 ms 400 ms 640 ms 1 0 1 262,144 330 ms 800 ms 1280 ms 1 1 0 524,288 660 ms 1.60 sec 2.60 sec 1 1 1 1,048,576 1.3 sec 3.20 sec 5.30 sec wds0 su01476 wds1 wds2 wdclk wdrun wdovf e e 0 1 2 3 4 5 6 7 wdcon reset value: 30h for a watchdog reset. 10h for other rest sources if the watchdog is enabled via the wdte configuration bit. 00h for other reset sources if the watchdog is disabled via the wdte configuration bit. not bit addressable address: a7h figure 34. watchdog timer control register (wdcon)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 43 additional features the auxr1 register contains several special purpose control bits that relate to several chip features. auxr1 is described in figure 35. software reset the srst bit in auxr1 allows software the opportunity to reset the processor completely, as if an external reset or watchdog reset had occurred. if a value is written to auxr1 that contains a 1 at bit position 3, all sfrs will be initialized and execution will resume at program address 0000. care should be taken when writing to auxr1 to avoid accidental software resets. dual data pointers the dual data pointer (dptr) adds to the ways in which the processor can specify the address used with certain instructions. the dps bit in the auxr1 register selects one of the two data pointers. the dptr that is not currently selected is not accessible to software unless the dps bit is toggled. specific instructions affected by the data pointer selection are: ? inc dptr increments the data pointer by 1. ? jmp @a+dptr jump indirect relative to dptr value. ? mov dptr, #data16 load the data pointer with a 16-bit constant. ? movc a, @a+dptr move code byte relative to dptr to the accumulator. ? movx a, @dptr move data byte the accumulator to data memory relative to dptr. ? movx @dptr, a move data byte from data memory relative to dptr to the accumulator. also, any instruction that reads or manipulates the dph and dpl registers (the upper and lower bytes of the current dptr) will be affected by the setting of dps. the movx instructions have limited application for the p87lpc764 since the part does not have an external data bus. however, they may be used to access eprom configuration information (see eprom characteristics section). bit 2 of auxr1 is permanently wired as a logic 0. this is so that the dps bit may be toggled (thereby switching data pointers) simply by incrementing the auxr1 register, without the possibility of inadvertently altering other bits in the register. bit symbol function auxr1.7 kbf keyboard interrupt flag. set when any pin of port 0 that is enabled for the keyboard interrupt function goes low. must be cleared by software. auxr1.6 bod brown out disable. when set, turns off brownout detection and saves power. see power monitoring functions section for details. auxr1.5 boi brown out interrupt. when set, prevents brownout detection from causing a chip reset and allows the brownout detect function to be used as an interrupt. see the power monitoring functions section for details. auxr1.4 lpep low power eprom control bit. allows power savings in low voltage systems. set by software. can only be cleared by power-on or brownout reset. see the power reduction modes section for details. auxr1.3 srst software reset. when set by software, resets the 87lpc764 as if a hardware reset occurred. auxr1.2 e this bit contains a hard-wired 0. allows toggling of the dps bit by incrementing auxr1, without interfering with other bits in the register. auxr1.1 e reserved for future use. should not be set to 1 by user programs. auxr1.0 dps data pointer select. chooses one of two data pointers for use by the program. see text for details. dps su01184 e 0 srst lpep boi bod kbf 0 1 2 3 4 5 6 7 auxr1 reset value: 00h not bit addressable address: a2h figure 35. auxr1 register
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 44 eprom characteristics programming of the eprom on the p87lpc764 is accomplished with a serial programming method. commands, addresses, and data are transmitted to and from the device on two pins after programming mode is entered. serial programming allows easy implementation of in-system programming of the p87lpc764 in an application board. details of in-system programming can be found in application note an466. the p87lpc764 contains three signature bytes that can be read and used by an eprom programming system to identify the device. the signature bytes designate the device as an p87lpc764 manufactured by philips. the signature bytes may be read by the user program at addresses fc30h, fc31h and fc60h with the movc instruction, using the dptr register for addressing. a special user data area is also available for access via the movc instruction at addresses fce0h through fcffh. this acustomer codeo space is programmed in the same manner as the main code eprom and may be used to store a serial number, manufacturing date, or other application information. 32-byte customer code space a small supplemental eprom space is reserved for use by the customer in order to identify code revisions, store checksums, add a serial number to each device, or any other desired use. this area exists in the code memory space from addresses fce0h through fcffh. code execution from this space is not supported, but it may be read as data through the use of the movc instruction with the appropriate addresses. the memory may be programmed at the same time as the rest of the code memory and ucfg bytes are programmed. system configuration bytes a number of user configurable features of the p87lpc764 must be defined at power up and therefore cannot be set by the program after start of execution. those features are configured through the use of two eprom bytes that are programmed in the same manner as the eprom program space. the contents of the two configuration bytes, ucfg1 and ucfg2, are shown in figures 36 and 37. the values of these bytes may be read by the program through the use of the movx instruction at the addresses shown in the figure. bit symbol function ucfg1.7 wdte watchdog timer enable. when programmed (0), disables the watchdog timer. the timer may still be used to generate an interrupt. ucfg1.6 rpd reset pin disable. when 1 disables the reset function of pin p1.5, allowing it to be used as an input only port pin. ucfg1.5 prhi port reset high. when 1, ports reset to a high state. when 0, ports reset to a low state. ucfg1.4 bov brownout voltage select. when 1, the brownout detect voltage is 2.5v. when 0, the brownout detect voltage is 3.8v. this is described in the power monitoring functions section. ucfg1.3 clkr clock rate select. when 0, the cpu clock rate is divided by 2. this results in machine cycles taking 12 cpu clocks to complete as in the standard 80c51. for full backward compatibility, this division applies to peripheral timing as well. ucfg1.20 fosc2fsoc0 cpu oscillator type select. see oscillator section for additional information. combinations other than those shown below should not be used. they are reserved for future use. fosc2fosc0 oscillator configuration 1 1 1 external clock input on x1 (default setting for an unprogrammed part). 0 1 1 internal rc oscillator, 6 mhz. for tolerance, see ac electrical characteristics table. 0 1 0 low frequency crystal, 20 khz to 100 khz. 0 0 1 medium frequency crystal or resonator, 100 khz to 4 mhz. 0 0 0 high frequency crystal or resonator, 4 mhz to 20 mhz. fosc0 su01477 fosc1 fosc2 clkr bov prhi rpd wdte 0 1 2 3 4 5 6 7 ucfg1 unprogrammed value: ffh address: fd00h figure 36. eprom system configuration byte 1 (ucfg1)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 45 bit symbol function ucfg2.7, 6 sb2, sb1 eprom security bits. see table entitled, aeprom security bitso for details. ucfg2.50 e reserved for future use. e su01186 e e e e e sb1 sb2 0 1 2 3 4 5 6 7 ucfg2 unprogrammed value: ffh address: fd01h figure 37. eprom system configuration byte 2 (ucfg2) security bits when neither of the security bits are programmed, the code in the eprom can be verified. when only security bit 1 is programmed , all further programming of the eprom is disabled. at that point, only security bit 2 may still be programmed. when both security bits are p rogrammed, eprom verify is also disabled. table 11. eprom security bits sb2 sb1 protection description 1 1 both security bits unprogrammed. no program security features enabled. eprom is programmable and verifiable. 1 0 only security bit 1 programmed. further eprom programming is disabled. security bit 2 may still be programmed. 0 1 only security bit 2 programmed. this combination is not supported. 0 0 both security bits programmed. all eprom verification and programming are disabled. absolute maximum ratings parameter rating unit operating temperature under bias 55 to +125 c storage temperature range 65 to +150 c voltage on rst /v pp pin to v ss 0 to +11.0 v voltage on any other pin to v ss 0.5 to v dd +0.5v v maximum i ol per i/o pin 20 ma power dissipation (based on package heat transfer, not device power consumption) 1.5 w notes: 1. stresses above those listed under absolute maximum ratings may cause permanent damage to the device. this is a stress rating only and functional operation of the device at these or any conditions other than those described in the ac and dc electrical characteri stics section of this specification are not implied. 2. this product includes circuitry specifically designed for the protection of its internal devices from the damaging effects of excessive static charge. nonetheless, it is suggested that conventional precautions be taken to avoid applying greater than the rated maximum. 3. parameters are valid over operating temperature range unless otherwise specified. all voltages are with respect to vss unless otherwise noted.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 46 dc electrical characteristics (for p87lpc764bd, bn, bdh, fn, fd, fdh, bd/01, bdh/01) v dd = 2.7 v to 6.0 v unless otherwise specified; t amb = 0 c to +70 c or 40 c to +85 c, unless otherwise specified. symbol parameter test conditions limits unit symbol parameter test conditions min typ 1 max unit i dd power su pp ly current o p erating 5.0 v, 20 mhz 11 15 25 ma i dd power su ly current , o erating 3.0 v, 10 mhz 11 4 7 ma i id power su pp ly current idle mode 5.0 v, 20 mhz 11 6 10 ma i id power su ly current , idle mode 3.0 v, 10 mhz 11 2 4 ma i pd power su pp ly current power down mode 5.0 v 11 1 10 m a i pd power su ly current , power down mode 3.0 v 11 1 5 m a v ram ram keep-alive voltage 1.5 v v il in p ut low voltage (ttl in p ut) 4.0 v < v dd < 6.0 v 0.5 0.2 v dd 0.1 v v il in ut low voltage (ttl in ut) 2.7 v < v dd < 4.0 v 0.5 0.7 v v il1 negative going threshold (schmitt input) 0.5 0.3 v dd v v ih input high voltage (ttl input) 0.2 v dd +0.9 v dd +0.5 v v ih1 positive going threshold (schmitt input) 0.7 v dd v dd +0.5 v hys hysteresis voltage 0.2 v dd v v ol output low voltage all ports 5, 9 i ol = 3.2 ma, v dd = 2.7 v 0.4 v v ol1 output low voltage all ports 5, 9 i ol = 20 ma, v dd = 2.7 v 1.0 v v oh out p ut high voltage all p orts 3 i oh = 20 m a, v dd = 2.7 v v dd 0.7 v v oh out ut high voltage , all orts 3 i oh = 30 m a, v dd = 4.5 v v dd 0.7 v v oh1 output high voltage, all ports 4 i oh = 1.0 ma, v dd = 2.7 v v dd 0.7 v c io input/output pin capacitance 10 15 pf i il logical 0 input current, all ports 8 v in = 0.4 v 50 m a i li input leakage current, all ports 7 v in = v il or v ih 2 m a i tl logical 1 to 0 transition current all p orts 3, 6 v in = 1.5 v at v dd = 3.0 v 30 250 m a i tl logical 1 to 0 transition current , all orts 3 , 6 v in = 2.0 v at v dd = 5.5 v 150 650 m a r rst internal reset pull-up resistor 14 40 225 k w v bolow brownout trip voltage with bov = 1 12 2.35 2.69 v v bohi brownout trip voltage with bov = 0 3.45 3.99 v v ref reference voltage 1.11 1.26 1.41 v t c (v ref ) temperature coefficient tbd ppm/ c ss supply sensitivity tbd %/v notes: 1. typical ratings are not guaranteed. the values listed are at room temperature, 5 v. 2. see other figures for details. active mode: i cc(max) = tbd idle mode: i cc(max) = tbd 3. ports in quasi-bidirectional mode with weak pull-up (applies to all port pins with pull-ups). does not apply to open drain pi ns. 4. ports in push-pull mode. does not apply to open drain pins. 5. in all output modes except high impedance mode. 6. port pins source a transition current when used in quasi-bidirectional mode and externally driven from 1 to 0. this current i s highest when v in is approximately 2 v. 7. measured with port in high impedance mode. parameter is guaranteed but not tested at cold temperature. 8. measured with port in quasi-bidirectional mode. 9. under steady state (non-transient) conditions, i ol must be externally limited as follows: maximum i ol per port pin: 20 ma maximum total i ol for all outputs: 80 ma maximum total i oh for all outputs: 5 ma if i ol exceeds the test condition, v ol may exceed the related specification. pins are not guaranteed to sink current greater than the listed test conditions. 10. pin capacitance is characterized but not tested. 11. the i dd , i id , and i pd specifications are measured using an external clock with the following functions disabled: comparators, brownout detect, and watchdog timer. for v dd = 3 v, lpep = 1. refer to the appropriate figures on the following pages for additional current drawn by each of these functions and detailed graphs for other frequency and voltage combinations. 12. devices initially operating at v dd = 2.7v or above and at f osc = 10 mhz or less are guaranteed to continue to execute instructions correctly at the brownout trip point. initial power-on operation below v dd = 2.7 v is not guaranteed. 13. devices initially operating at v dd = 4.0 v or above and at f osc = 20 mhz or less are guaranteed to continue to execute instructions correctly at the brownout trip point. initial power-on operation below v dd = 4.0 v and f osc > 10 mhz is not guaranteed. 14. this internal resistor is disconnected if p1.5 is used as a general purpose input pin instead of the reset pin.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 47 comparator electrical characteristics (for p87lpc764bd, bn, bdh, fn, fd, fdh, bd/01, bdh/01) v dd = 3.0 v to 6.0 v unless otherwise specified; t amb = 0 c to +70 c or 40 c to +85 c, unless otherwise specified symbol parameter test conditions limits unit symbol parameter test conditions min typ max unit v io offset voltage comparator inputs 1 10 mv v cr common mode range comparator inputs 0 v dd 0.3 v cmrr common mode rejection ratio 1 50 db response time 250 500 ns comparator enable to output valid 10 m s i il input leakage current, comparator 0 < v in < v dd 10 m a note: 1. this parameter is guaranteed by characterization, but not tested in production.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 48 ac electrical characteristics (for p87lpc764bd, bdh, bn, fn, fd, fdh) t amb = 0 c to +70 c or 40 c to +85 c, v dd = 2.7 v to 6.0 v unless otherwise specified; v ss = 0 v 1,2,3 symbol figure parameter limits unit symbol figure parameter min max unit external clock f osc 39 oscillator frequency (v dd = 4.0 v to 6.0 v) 0 20 mhz f osc 39 oscillator frequency (v dd = 2.7 v to 6.0 v) 0 10 mhz t c 39 clock period and cpu timing cycle 1/f osc ns f osc(tol) on-chip rc oscillator tolerance. applies to p87lpc764bdh 5 10 10 % f osc(tol) on-chip rc oscillator tolerance, all other devices 25 25 % t clcx 39 clock low-time 4 f osc = 20 mhz 20 ns t clcx 39 f osc = 10 mhz 40 ns t chcx 39 clock high-time 4 f osc = 20 mhz 20 ns t chcx 39 f osc = 10 mhz 40 ns shift register t xlxl 38 serial port clock cycle time 6t c ns t qvxh 38 output data setup to clock rising edge 5t c 133 ns t xhqx 38 output data hold after clock rising edge 1t c 80 ns t xhdv 38 input data setup to clock rising edge 5t c 133 ns t xhdx 38 input data hold after clock rising edge 0 ns notes: 1. parameters are valid over operating temperature range unless otherwise specified. 2. load capacitance for all outputs = 80 pf. 3. parts are guaranteed to operate down to 0 hz. 4. applies only to an external clock source, not when a crystal is connected to the x1 and x2 pins. 5. for availability of other devices with this specification, please contact philips sales office.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 49 ac electrical characteristics (for p87lpc764bd/01, bdh/01) t amb = 0 c to +70 c, v dd = 2.7 v to 6.0 v unless otherwise specified; v ss = 0 v 1,2,3 symbol figure parameter limits unit symbol figure parameter min max unit external clock f osc 39 oscillator frequency (v dd = 4.0 v to 6.0 v) 0 20 mhz f osc 39 oscillator frequency (v dd = 2.7 v to 6.0 v) 0 10 mhz t c 39 clock period and cpu timing cycle 1/f osc ns t clcx 39 clock low-time 1 f osc = 20 mhz 20 ns t clcx 39 f osc = 10 mhz 40 ns t chcx 39 clock high-time 1 f osc = 20 mhz 20 ns t chcx 39 f osc = 10 mhz 40 ns internal rc oscillator f osc(cal) on-chip rc oscillator calibration 2 f osc(rc) = 6 mhz 1 +1 % f osc(tol) on-chip rc oscillator, 0 c to +50 c 3,4 tol. f osc(rc) = 6 mhz 2.5 +2.5 % f osc(tol) on-chip rc oscillator, 0 c to +70 c 3 tol. f osc(rc) = 6 mhz 5 5 +2.5 % shift register t xlxl 38 serial port clock cycle time 6t c ns t qvxh 38 output data setup to clock rising edge 5t c 133 ns t xhqx 38 output data hold after clock rising edge 1t c 80 ns t xhdv 38 input data setup to clock rising edge 5t c 133 ns t xhdx 38 input data hold after clock rising edge 0 ns notes: 1. applies only to an external clock source, not when a crystal is connected to the x1 and x2 pins. 2. tested at v dd = 5.0 v and room temperature. 3. these parameters are characterized but not tested. 4. +/ 2.5% accuracy enables serial communication over the uart with the internal oscillator. 5. min frequency at hot temperature.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 50 dc electrical characteristics (for p87lpc764hdh) v dd = 4.5 v to 5.5 v; t amb = 40 c to +125 c. symbol parameter test conditions limits unit symbol parameter test conditions min typ 1 max unit i dd power supply current, operating 5.0 v, 20 mhz 11 15 25 ma i id power supply current, idle mode 5.0 v, 20 mhz 11 6 10 ma i pd power supply current, power down mode 5.0 v 11 1 10 m a v ram ram keep-alive voltage 1.5 v v il input low voltage (ttl input) 4.0 v < v dd < 6.0 v 0.5 0.2 v dd 0.1 v v il1 negative going threshold (schmitt input) 0.5 0.3 v dd v v ih input high voltage (ttl input) 0.2 v dd +0.9 v dd +0.5 v v ih1 positive going threshold (schmitt input) 0.7 v dd v dd +0.5 v hys hysteresis voltage 0.2 v dd v v ol output low voltage all ports 5, 9 i ol = 3.2 ma, v dd = 2.7 v 0.4 v v ol1 output low voltage all ports 5, 9 i ol = 20 ma, v dd = 2.7 v 1.0 v v oh output high voltage, all ports 3 i oh = 30 m a, v dd = 4.5 v v dd 0.7 v v oh1 output high voltage, all ports 4 i oh = 1.0 ma, v dd = 2.7 v v dd 0.7 v c io input/output pin capacitance 10 15 pf i il logical 0 input current, all ports 8 v in = 0.4 v 50 m a i li input leakage current, all ports 7 v in = v il or v ih 2 m a i tl logical 1 to 0 transition current, all ports 3, 6 v in = 2.0 v at v dd = 5.5 v 150 650 m a r rst internal reset pull-up resistor 14 40 225 k w v bolow brownout trip voltage with bov = 1 12 2.35 2.69 v v bohi brownout trip voltage with bov = 0 3.45 3.99 v v ref reference voltage 1.11 1.26 1.41 v t c (v ref ) temperature coefficient tbd ppm/ c ss supply sensitivity tbd %/v notes: 1. typical ratings are not guaranteed. the values listed are at room temperature, 5 v. 2. see other figures for details. active mode: i cc(max) = tbd idle mode: i cc(max) = tbd 3. ports in quasi-bidirectional mode with weak pull-up (applies to all port pins with pull-ups). does not apply to open drain pi ns. 4. ports in push-pull mode. does not apply to open drain pins. 5. in all output modes except high impedance mode. 6. port pins source a transition current when used in quasi-bidirectional mode and externally driven from 1 to 0. this current i s highest when v in is approximately 2 v. 7. measured with port in high impedance mode. parameter is guaranteed but not tested at cold temperature. 8. measured with port in quasi-bidirectional mode. 9. under steady state (non-transient) conditions, i ol must be externally limited as follows: maximum i ol per port pin: 20 ma maximum total i ol for all outputs: 80 ma maximum total i oh for all outputs: 5 ma if i ol exceeds the test condition, v ol may exceed the related specification. pins are not guaranteed to sink current greater than the listed test conditions. 10. pin capacitance is characterized but not tested. 11. the i dd , i id , and i pd specifications are measured using an external clock with the following functions disabled: comparators, brownout detect, and watchdog timer. for v dd = 3 v, lpep = 1. refer to the appropriate figures on the following pages for additional current drawn by each of these functions and detailed graphs for other frequency and voltage combinations. 12. devices initially operating at v dd = 2.7v or above and at f osc = 10 mhz or less are guaranteed to continue to execute instructions correctly at the brownout trip point. initial power-on operation below v dd = 2.7 v is not guaranteed. 13. devices initially operating at v dd = 4.0 v or above and at f osc = 20 mhz or less are guaranteed to continue to execute instructions correctly at the brownout trip point. initial power-on operation below v dd = 4.0 v and f osc > 10 mhz is not guaranteed. 14. this internal resistor is disconnected if p1.5 is used as a general purpose input pin instead of the reset pin.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 51 comparator electrical characteristics (for p87lpc764hdh) v dd = 4.5 v to 5.5 v; t amb = 40 c to +125 c symbol parameter test conditions limits unit symbol parameter test conditions min typ max unit v io offset voltage comparator inputs 1 20 mv v cr common mode range comparator inputs 0 v dd 0.3 v cmrr common mode rejection ratio 1 50 db response time 250 500 ns comparator enable to output valid 10 m s i il input leakage current, comparator 0 < v in < v dd 10 m a note: 1. this parameter is guaranteed by characterization, but not tested in production.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 52 ac electrical characteristics (for p87lpc764hdh) v dd = 4.5 v to 5.5 v; t amb = 40 c to +125 c ; v ss = 0 v 1,2,3 symbol figure parameter limits unit symbol figure parameter min max unit external clock f osc 39 0 16 mhz t c 39 clock period and cpu timing cycle 1/f osc ns f osc(tol) on-chip rc oscillator tolerance 10 +10 % t chcx 39 clock high-time 4 f osc = 16 mhz 25 ns t clcx 39 clock low-time 4 f osc = 16 mhz 25 ns shift register t xlxl 38 serial port clock cycle time 6t c ns t qvxh 38 output data setup to clock rising edge 5t c 133 ns t xhqx 38 output data hold after clock rising edge 1t c 80 ns t xhdv 38 input data setup to clock rising edge 5t c 133 ns t xhdx 38 input data hold after clock rising edge 0 ns notes: 1. parameters are valid over operating temperature range unless otherwise specified. 2. load capacitance for all outputs = 80 pf. 3. parts are guaranteed to operate down to 0 hz. 4. applies only to an external clock source, not when a crystal is connected to the x1 and x2 pins. 5. for availability of other devices with this specification, please contact philips sales office.
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 53 clear ri t xlxl clock t xhqx t qvxh output data write to sbuf input data t xhdv t xhdx set ti set ri su01187 7 123456 0 valid valid valid valid valid valid valid valid figure 38. shift register mode timing su01188 v dd 0.5 0.45v 0.2v dd + 0.9 0.2 v dd 0.1 t chcl t clch t chcx t clcx t c figure 39. external clock timing su01202 100 10 1 10 100 idd (ua) frequency (khz) 6.0 v 5.0 v 4.0 v 3.3 v 2.7 v figure 40. typical idd versus frequency (low frequency oscillator, 25 c) su01203 1000 100 10 100 10,000 idd (ua) frequency (khz) 1,000 6.0 v 5.0 v 2.7 v 6.0 v 5.0 v 4.0 v 3.3 v 2.7 v figure 41. typical idd versus frequency (medium frequency oscillator, 25 c)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 54 su01204 10,000 1,000 100 1 100 idd (ua) frequency (mhz) 10 6.0 v 5.0 v 4.0 v 3.3 v 2.7 v figure 42. typical idd versus frequency (high frequency oscillator, 25 c) su01205 100,000 100 10 10 100,000 idd (ua) frequency (khz) 1,000 10,000 6.0 v 5.0 v 4.0 v 3.3 v 2.7 v 100 1,000 10,000 figure 43. typical active idd versus frequency (external clock, 25 c, lpep=0) su01206 10,000 100 1 10 10,000 idd (ua) frequency (khz) 4.0 v 3.3 v 2.7 v 100 1,000 1,000 10 figure 44. typical active idd versus frequency (external clock, 25 c, lpep=1) su01207 100 10 1 10 100 idd (ua) frequency (khz) 4.0 v 3.3 v 2.7 v 1,000 10,000 1,000 10,000 figure 45. typical idle idd versus frequency (external clock, 25 c, lpep=1) su01208 10,000 1,000 10 10 100,000 idd (ua) frequency (khz) 100 1,000 10,000 100 6.0 v 5.0 v 4.0 v 3.3 v 2.7 v figure 46. typical idle idd versus frequency (external clock, 25 c, lpep=0)
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 55 dip20: plastic dual in-line package; 20 leads (300 mil) sot146-1
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 56 so20: plastic small outline package; 20 leads; body width 7.5 mm sot163-1
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 57 tssop20: plastic thin shrink small outline package; 20 leads; body width 4.4 mm sot360-1
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 58 revision history rev date description _11 20030903 product data (9397 750 11121); ecn 853-2401 30269 modifications: ? added bd/01, bdh/01 and hdh part types _10 20011026 preliminary data (9397 750 09017); previous release
philips semiconductors product data p87lpc764 low power, low price, low pin count (20 pin) microcontroller with 4 kbyte otp 2003 sep 03 59 purchase of philips i 2 c components conveys a license under the philips' i 2 c patent to use the components in the i 2 c system provided the system conforms to the i 2 c specifications defined by philips. this specification can be ordered using the code 9398 393 40011. definitions short-form specification e the data in a short-form specification is extracted from a full data sheet with the same type number and title. for detailed i nformation see the relevant data sheet or data handbook. limiting values definition e limiting values given are in accordance with the absolute maximum rating system (iec 60134). stress above one or more of the l imiting values may cause permanent damage to the device. these are stress ratings only and operation of the device at these or at any o ther conditions above those given in the characteristics sections of the specification is not implied. exposure to limiting values for extended periods may affec t device reliability. application information e applications that are described herein for any of these products are for illustrative purposes only. philips semiconductors ma ke no representation or warranty that such applications will be suitable for the specified use without further testing or modificatio n. disclaimers life support e these products are not designed for use in life support appliances, devices, or systems where malfunction of these products ca n reasonably be expected to result in personal injury. philips semiconductors customers using or selling these products for use in such applica tions do so at their own risk and agree to fully indemnify philips semiconductors for any damages resulting from such application. right to make changes e philips semiconductors reserves the right to make changes in the productseincluding circuits, standard cells, and/or softwaree described or contained herein in order to improve design and/or performance. when the product is in full production (status `production') , relevant changes will be communicated via a customer product/process change notification (cpcn). philips semiconductors assumes no responsibility or liability for th e use of any of these products, conveys no license or title under any patent, copyright, or mask work right to these products, and makes no representations or warranti es that these products are free from patent, copyright, or mask work right infringement, unless otherwise specified. contact information for additional information please visit http://www.semiconductors.philips.com . fax: +31 40 27 24825 for sales offices addresses send e-mail to: sales.addresses@www.semiconductors.philips.com . ? koninklijke philips electronics n.v. 2003 all rights reserved. printed in u.s.a. date of release: 09-03 document order number: 9397 750 11121  

data sheet status [1] objective data preliminary data product data product status [2] [3] development qualification production definitions this data sheet contains data from the objective specification for product development. philips semiconductors reserves the right to change the specification in any manner without notice. this data sheet contains data from the preliminary specification. supplementary data will be published at a later date. philips semiconductors reserves the right to change the specification without notice, in order to improve the design and supply the best possible product. this data sheet contains data from the product specification. philips semiconductors reserves the right to make changes at any time in order to improve the design, manufacturing and supply. relevant changes will be communicated via a customer product/process change notification (cpcn). data sheet status [1] please consult the most recently issued data sheet before initiating or completing a design. [2] the product status of the device(s) described in this data sheet may have changed since this data sheet was published. the l atest information is available on the internet at url http://www.semiconductors.philips.com. [3] for data sheets describing multiple type numbers, the highest-level product status determines the data sheet status. level i ii iii


▲Up To Search▲   

 
Price & Availability of P87LPC764FDH

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X